:root {
  --navy-950: #0a1729;
  --navy-900: #11233f;
  --navy-800: #1b3559;
  --navy-700: #294a73;
  --ink: #192534;
  --muted: #637083;
  --line: #d9e0e7;
  --line-soft: #e9edf1;
  --canvas: #edf1f4;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --coral: #e9505a;
  --coral-dark: #c83844;
  --teal: #19806e;
  --teal-soft: #e3f4ef;
  --amber: #d78b13;
  --amber-soft: #fff3d9;
  --blue: #2d72c7;
  --blue-soft: #e9f2fd;
  --green: #2d8a5b;
  --green-soft: #e9f6ef;
  --shadow-sm: 0 1px 2px rgba(16, 34, 61, 0.06), 0 2px 8px rgba(16, 34, 61, 0.04);
  --shadow-md: 0 12px 30px rgba(16, 34, 61, 0.12);
  --radius-sm: 7px;
  --radius: 11px;
  --radius-lg: 17px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -10%, rgba(45, 114, 199, 0.08), transparent 28rem),
    var(--canvas);
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

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

h1 {
  margin-bottom: 7px;
  color: var(--navy-950);
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  color: var(--navy-950);
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 68px;
  padding: 0 26px;
  color: #fff;
  background: rgba(17, 35, 63, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 6px 18px rgba(9, 22, 41, 0.15);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 190px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  overflow: hidden;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #030507;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  font-size: 1.05rem;
  font-weight: 900;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand strong {
  font-size: 1.04rem;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 4px;
  color: #aebbd0;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-self: stretch;
  justify-content: center;
  gap: 4px;
}

.main-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: #b9c5d7;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: #fff;
}

.main-nav a[aria-current="page"]::after {
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--coral);
  content: "";
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.live-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c4cfde;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.live-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #56d29c;
  box-shadow: 0 0 0 4px rgba(86, 210, 156, 0.14);
}

.actor-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.actor-form label {
  color: #9eacc0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.actor-form select {
  min-width: 116px;
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  background: var(--navy-800);
  font-size: 0.8rem;
  font-weight: 700;
}

.access-signin {
  color: #c5cfdd;
  font-size: 0.7rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.access-signin:hover {
  color: #fff;
}

.access-status-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.access-status-form > span {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.access-status-form strong {
  color: #fff;
  font-size: 0.7rem;
}

.access-status-form small {
  margin-top: 3px;
  color: #9eacc0;
  font-size: 0.58rem;
}

.access-status-form button {
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #fff;
  background: var(--navy-800);
  font-size: 0.62rem;
  font-weight: 800;
}

.page-shell {
  width: min(1900px, 100%);
  margin: 0 auto;
  padding: 26px 28px 52px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 20px 0 20px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--coral-dark);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page-subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.60rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(45, 114, 199, 0.28);
  outline-offset: 2px;
}

.btn-primary {
  border-color: var(--coral);
  color: #fff;
  background: var(--coral);
  box-shadow: 0 3px 8px rgba(233, 80, 90, 0.2);
}

.btn-primary:hover {
  border-color: var(--coral-dark);
  background: var(--coral-dark);
}

.btn-quiet {
  border-color: var(--line);
  color: var(--navy-800);
  background: var(--surface);
}

.btn-quiet:hover {
  border-color: #aebac8;
  background: var(--surface-soft);
}

.btn-warn {
  border-color: #edbd64;
  color: #77480a;
  background: var(--amber-soft);
}

.btn-danger {
  border-color: #ebb7bb;
  color: #a12631;
  background: #fff1f2;
}

.text-button {
  padding: 5px 3px;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demo-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #d8c898;
  border-radius: 9px;
  color: #5f501f;
  background: #fff9e9;
  font-size: 0.77rem;
}

.demo-banner strong {
  color: #46380c;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 13px;
}

.metric-card {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.metric-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--blue);
  content: "";
}

.metric-card span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--navy-950);
  font-size: 1.9rem;
  line-height: 1;
}

.metric-card:hover,
.metric-card.is-selected {
  border-color: #abb9c9;
  box-shadow: 0 5px 16px rgba(16, 34, 61, 0.09);
  transform: translateY(-1px);
}

.metric-triage::before {
  background: var(--amber);
}

.metric-doctor::before {
  background: var(--blue);
}

.metric-critical::before {
  background: var(--coral);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) repeat(6, minmax(120px, 150px)) auto auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.filter-bar input,
.filter-bar select,
.patient-dialog input,
.patient-dialog select,
.patient-dialog textarea,
.compact-grid input,
.compact-grid select,
.compact-grid textarea,
.detail-task-form input,
.detail-task-form select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.filter-bar input:hover,
.filter-bar select:hover,
.patient-dialog input:hover,
.patient-dialog select:hover,
.patient-dialog textarea:hover,
.compact-grid input:hover,
.compact-grid select:hover,
.compact-grid textarea:hover {
  border-color: #b2bfcc;
}

.search-field input {
  padding-left: 35px;
  background-image:
    radial-gradient(circle, transparent 45%, #728094 47%, #728094 58%, transparent 60%),
    linear-gradient(45deg, transparent 44%, #728094 45%, #728094 55%, transparent 56%);
  background-position: 12px 10px, 24px 23px;
  background-repeat: no-repeat;
  background-size: 14px 14px, 7px 7px;
}

.clear-filters {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.patient-board {
  overflow: hidden;
  border: 1px solid #cfd8e1;
  border-radius: var(--radius);
  background: #e5ebf0;
  box-shadow: var(--shadow-sm);
}

.board-head,
.patient-row {
  display: grid;
  grid-template-columns: 8px minmax(300px, 1.8fr) 105px 95px 145px 195px 130px minmax(210px, 1.25fr) 110px;
}

.board-head {
  min-width: 1400px;
  align-items: center;
  border-bottom: 1px solid #cbd5df;
  color: #68768a;
  background: #f4f7f9;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.board-head span {
  padding: 10px 12px;
  border-right: 1px solid #e2e7ec;
}

#patient-rows {
  min-width: 1400px;
}

.patient-row {
  position: relative;
  min-height: 152px;
  border-bottom: 1px solid #d6dde4;
  background: var(--surface);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.patient-row:last-child {
  border-bottom: 0;
}

.patient-row:hover {
  z-index: 2;
  box-shadow: 0 7px 20px rgba(16, 34, 61, 0.1);
}

.priority-rail {
  background: #7a8999;
}

.priority-stat .priority-rail,
.detail-hero.priority-stat::before {
  background: #c92f3d;
}

.priority-urgent .priority-rail,
.detail-hero.priority-urgent::before {
  background: #e58c18;
}

.priority-stable .priority-rail,
.detail-hero.priority-stable::before {
  background: #278a70;
}

.priority-routine .priority-rail,
.detail-hero.priority-routine::before {
  background: #6082aa;
}

.priority-stat {
  background: linear-gradient(90deg, #ffe5e8 0, #fff3f4 24%, #fff 58%);
}

.priority-urgent {
  background: linear-gradient(90deg, #ffedcf 0, #fff8ed 24%, #fff 58%);
}

.patient-cell {
  min-width: 0;
  padding: 13px 11px;
  border-right: 1px solid var(--line-soft);
}

.patient-cell:last-child {
  border-right: 0;
}

.patient-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.sex-badge {
  display: inline-grid;
  min-width: 24px;
  min-height: 20px;
  padding: 2px 6px;
  place-items: center;
  border: 1px solid #c9d5e1;
  border-radius: 6px;
  color: #53647a;
  background: #f5f8fb;
  font-size: 0.59rem;
  font-weight: 900;
}

.inline-edit {
  min-width: 0;
}

.inline-edit-trigger {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.inline-edit-trigger:hover .inline-edit-value {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.inline-edit-icon {
  color: #8a97a6;
  font-size: 0.66rem;
  opacity: 0.55;
}

.inline-edit-trigger:hover .inline-edit-icon,
.inline-edit-trigger:focus-visible .inline-edit-icon {
  opacity: 1;
}

.inline-edit-form {
  width: 100%;
}

.inline-edit-form[hidden],
.inline-edit-trigger[hidden] {
  display: none;
}

.inline-edit-form input,
.inline-edit-form textarea {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid #9db4cc;
  border-radius: 6px;
  background: #fff;
  font-size: 0.75rem;
  resize: vertical;
}

.inline-edit-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.inline-edit-actions button {
  padding: 3px 7px;
  border: 1px solid #bcc8d5;
  border-radius: 5px;
  color: var(--navy-800);
  background: #f7f9fb;
  font-size: 0.62rem;
  font-weight: 800;
}

.patient-name .inline-edit-trigger {
  color: var(--navy-950);
  font-size: 1.14rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.patient-full-name {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
}

.owner-last-name .inline-edit-trigger {
  color: var(--navy-950);
  font-size: 1.02rem;
  font-weight: 850;
}

.alert-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.alert-edit-toggle {
  padding: 3px 6px;
  border: 1px dashed #d59198;
  border-radius: 99px;
  color: #9a3540;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.58rem;
  font-weight: 850;
}

.board-alert-editor {
  width: 100%;
  margin: 4px 0 7px;
  padding: 6px;
}

.board-alert-editor[hidden] {
  display: none;
}

.patient-name .inline-edit-trigger:hover {
  color: var(--blue);
}

.priority-badge,
.alert-pill {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 99px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.priority-badge {
  color: #fff;
  background: var(--navy-800);
}

.priority-stat .priority-badge {
  background: #c92f3d;
}

.priority-urgent .priority-badge {
  color: #684007;
  background: #f3c165;
}

.priority-stable .priority-badge {
  background: #278a70;
}

.priority-routine .priority-badge {
  background: #6082aa;
}

.alert-pill {
  border: 1px solid #f3acb2;
  color: #a02833;
  background: #fff0f1;
}

.alert-pill.alert-gray,
.alert-editor-pill.alert-gray {
  border-color: #cbd3dc;
  color: #536171;
  background: #f2f4f6;
}

.alert-pill.alert-green,
.alert-editor-pill.alert-green {
  border-color: #9ed3b8;
  color: #246b49;
  background: #edf8f3;
}

.alert-pill.alert-blue,
.alert-editor-pill.alert-blue {
  border-color: #a9caec;
  color: #255f96;
  background: #edf5fd;
}

.alert-pill.alert-yellow,
.alert-editor-pill.alert-yellow {
  border-color: #ebc46c;
  color: #79520b;
  background: #fff7df;
}

.alert-pill.alert-red,
.alert-editor-pill.alert-red {
  border-color: #f3acb2;
  color: #a02833;
  background: #fff0f1;
}

.patient-identity > p {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.patient-identity .complaint .inline-edit-trigger {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #334154;
  font-size: 0.79rem;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.notes-preview {
  overflow: hidden;
  margin-top: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-preview .inline-edit-trigger {
  width: 100%;
  overflow: hidden;
  color: #6f7c8d;
  font-size: 0.69rem;
  font-style: italic;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.workflow-badge {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid #cbd5df;
  border-radius: 99px;
  color: #536276;
  background: #f7f9fb;
  font-size: 0.59rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.workflow-badge.is-complete {
  border-color: #abd5c1;
  color: #216346;
  background: #edf8f3;
}

.workflow-badge.needs-action {
  border-color: #e9bf70;
  color: #70450b;
  background: #fff6e4;
}

.workflow-badge.is-overdue {
  border-color: #df7881;
  color: #8e1f29;
  background: #ffecee;
  box-shadow: 0 0 0 3px rgba(201, 47, 61, 0.09);
}

.spike-overdue .arrival-cell {
  background: rgba(255, 232, 206, 0.55);
}

.new-arrival .arrival-cell strong::after {
  display: inline-block;
  margin-left: 6px;
  color: var(--blue);
  content: "NEW";
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.arrival-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.arrival-cell strong {
  color: var(--navy-950);
  font-size: 0.86rem;
}

.arrival-cell span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.weight-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-900);
  text-align: center;
}

.weight-cell strong {
  font-size: 0.86rem;
}

.patient-cell select {
  width: 100%;
  height: 34px;
  padding: 5px 25px 5px 7px;
  border: 1px solid #d1d9e1;
  border-radius: 7px;
  color: #2b3b4f;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.72rem;
  font-weight: 700;
}

.patient-cell select + select {
  margin-top: 7px;
}

.location-select {
  border-color: #b9cbe2 !important;
  color: #224f80 !important;
  background: #f2f7fd !important;
}

.status-select {
  color: #516174 !important;
  background: #f8fafb !important;
}

.team-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.team-edit {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-cell label {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 5px;
}

.team-cell label span {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-cell select {
  height: 30px;
  margin: 0 !important;
  font-size: 0.68rem;
}

.team-person {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-height: 21px;
}

.team-person span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-person strong {
  overflow: hidden;
  color: #3b4a5e;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whiteboard-only {
  display: none;
}

.shift-roster-strip {
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid #cbd7e3;
  border-radius: 8px;
  background: #f8fafc;
}

.roster-strip-heading {
  display: flex;
  min-width: 72px;
  flex-direction: column;
  color: var(--navy-900);
  line-height: 1.1;
}

.roster-strip-heading strong {
  font-size: 0.7rem;
  text-transform: uppercase;
}

.roster-strip-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.58rem;
}

.roster-tags {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  gap: 4px;
}

.roster-tag {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid #cbd7e3;
  border-radius: 7px;
  color: #2e435b;
  background: #fff;
  font-size: 0.63rem;
}

.roster-tag small {
  color: var(--muted);
  font-size: 0.56rem;
}

.roster-doctor {
  border-color: #abc8e7;
  background: #edf5fd;
}

.roster-technician,
.roster-nurse {
  border-color: #add7c5;
  background: #edf8f3;
}

.roster-csr {
  border-color: #dec695;
  background: #fff8e8;
}

.roster-empty {
  color: var(--muted);
  font-size: 0.66rem;
  font-style: italic;
}

.estimate-select {
  color: #5b450a !important;
  background: #fff9e9 !important;
}

.estimate-approved {
  color: #1c684a !important;
  background: #edf8f3 !important;
}

.estimate-declined {
  color: #a12631 !important;
  background: #fff1f2 !important;
}

.task-cell {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.task-list,
.detail-task-list,
.timeline {
  padding: 0;
  margin: 0;
  list-style: none;
}

.task-list {
  display: flex;
  max-height: 90px;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.task-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: #354357;
  font-size: 0.69rem;
}

.task-item > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item small {
  max-width: 54px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.59rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item .task-subscription-toggle {
  grid-column: 4;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  border-radius: 6px;
}

.task-item .bell-icon {
  width: 12px;
  height: 12px;
}

.task-toggle {
  display: grid;
  width: 18px;
  height: 18px;
  padding: 0;
  place-items: center;
  border: 1px solid #b8c3cf;
  border-radius: 5px;
  color: #fff;
  background: #fff;
  font-size: 0.64rem;
  font-weight: 900;
}

.is-complete .task-toggle {
  border-color: var(--green);
  background: var(--green);
}

.task-item.is-complete span,
.detail-task.is-complete strong {
  color: #8b96a3;
  text-decoration: line-through;
}

.empty-task {
  padding: 6px 0;
  color: #8c98a6;
  font-size: 0.69rem;
  font-style: italic;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 27px;
  gap: 4px;
  margin-top: auto;
}

.task-notify-option {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 750;
  white-space: nowrap;
}

.task-notify-option input {
  width: 14px !important;
  min-width: 14px;
  height: 14px !important;
  min-height: 14px !important;
  margin: 0;
  padding: 0;
}

.task-cell .task-notify-option span {
  display: none;
}

.task-form input {
  min-width: 0;
  height: 28px;
  padding: 4px 7px;
  border: 1px solid #d6dde4;
  border-radius: 6px;
  background: #fafbfc;
  font-size: 0.68rem;
}

.task-form button {
  display: grid;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid #b9c8d8;
  border-radius: 6px;
  color: var(--navy-800);
  background: #f0f5fa;
  font-size: 1rem;
  font-weight: 800;
}

.icon-toggle {
  display: inline-grid;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid #c8d3df;
  border-radius: 7px;
  color: var(--navy-800);
  background: #f7f9fb;
  cursor: pointer;
}

.icon-toggle:hover,
.icon-toggle:focus-visible {
  border-color: #8fa8c1;
  background: #edf4fb;
}

.icon-toggle.is-active {
  border-color: #7ba7d2;
  color: #1c639f;
  background: #e7f2fc;
}

.icon-toggle:disabled {
  cursor: wait;
  opacity: 0.55;
}

.bell-icon,
.eye-icon {
  display: block;
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}

.bell-icon {
  -webkit-mask-image: url("/static/icons/bell-slash.svg");
  mask-image: url("/static/icons/bell-slash.svg");
}

.icon-toggle.is-active .bell-icon {
  -webkit-mask-image: url("/static/icons/bell-solid.svg");
  mask-image: url("/static/icons/bell-solid.svg");
}

.eye-icon {
  -webkit-mask-image: url("/static/icons/eye-slash.svg");
  mask-image: url("/static/icons/eye-slash.svg");
}

.icon-toggle.is-active .eye-icon {
  -webkit-mask-image: url("/static/icons/eye-solid.svg");
  mask-image: url("/static/icons/eye-solid.svg");
}

.patient-watch-toggle {
  flex: 0 0 auto;
}

.action-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.action-cell .btn {
  min-height: 31px;
  padding: 5px 8px;
  font-size: 0.68rem;
}

.milestone-done {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 7px;
  color: #28724f;
  background: var(--green-soft);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  padding: 40px;
  background: var(--surface);
  text-align: center;
}

.empty-state strong {
  color: var(--navy-950);
  font-size: 1.1rem;
}

.empty-state p {
  margin: 6px 0 16px;
  color: var(--muted);
}

.patient-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 25px 80px rgba(9, 23, 43, 0.3);
}

.patient-dialog::backdrop {
  background: rgba(8, 20, 38, 0.64);
  backdrop-filter: blur(3px);
}

.patient-form {
  padding: 25px;
}

.dialog-heading,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dialog-heading {
  margin-bottom: 20px;
}

.dialog-heading .dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: #fff;
  font-size: 1.4rem;
  line-height: 1;
}

.dialog-actions .dialog-close {
  width: auto;
  height: auto;
  min-height: 36px;
  padding: 8px 13px;
  font-size: 0.72rem;
  line-height: 1.1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  color: #4d5b6d;
  font-size: 0.7rem;
  font-weight: 800;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.patient-dialog textarea,
.compact-grid textarea {
  resize: vertical;
}

.dialog-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #4d5b6d;
  font-size: 0.72rem;
  font-weight: 800;
}

.dialog-field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dialog-help {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.action-dialog {
  width: min(500px, calc(100% - 28px));
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line-soft);
}

.sync-banner {
  position: sticky;
  z-index: 90;
  top: 68px;
  padding: 9px 18px;
  color: #163c61;
  background: #e6f2ff;
  border-bottom: 1px solid #bed7f0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 750;
}

.sync-banner button {
  padding: 2px 7px;
  border: 0;
  color: #145a98;
  background: transparent;
  font-weight: 850;
  text-decoration: underline;
}

.live-status.is-offline {
  color: #ffd6d9;
}

.live-status.is-offline i {
  background: #ef6b75;
  box-shadow: 0 0 0 4px rgba(239, 107, 117, 0.14);
}

.toast-stack {
  position: fixed;
  z-index: 300;
  right: 22px;
  bottom: 22px;
  display: flex;
  max-width: calc(100vw - 44px);
  flex-flow: row-reverse wrap-reverse;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  width: min(320px, calc(100vw - 44px));
  min-height: 56px;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
  background: var(--navy-950);
  box-shadow: var(--shadow-md);
  font-size: 0.77rem;
  font-weight: 750;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast[role="link"] {
  cursor: pointer;
}

.toast-content {
  flex: 1;
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 3px;
  padding: 11px 14px;
}

.toast-title {
  display: block;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.25;
}

.toast-message {
  display: block;
  color: #fff;
  font-size: 0.77rem;
  font-weight: 750;
  line-height: 1.3;
}

.toast-content.has-title .toast-message {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.7rem;
  font-weight: 650;
}

.toast > button {
  display: grid;
  width: 50px;
  min-width: 50px;
  align-self: stretch;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  color: inherit;
  background: transparent;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.toast > button:hover,
.toast > button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.toast.is-info {
  border-color: #5f8fbd;
  background: #17395f;
}

.toast.is-alert {
  border-color: #ffe869;
  background: #ffb639;
}

.toast.is-urgent {
  border-color: #ffbd73;
  color: #fff;
  background: #9b2b32;
  box-shadow: 0 16px 40px rgba(116, 22, 30, 0.34);
}

.toast.is-error {
  border-color: #ef8f9a;
  background: #6f2130;
  box-shadow: 0 16px 40px rgba(87, 16, 28, 0.3);
}

.toast.is-persistent {
  border-width: 2px;
}

.whiteboard-view .toast:not(.is-error) {
  display: none;
}

.toast-countdown {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.72);
  transform: scaleX(1);
  transform-origin: left center;
  animation: toast-countdown var(--toast-duration, 4800ms) linear forwards;
}

@keyframes toast-countdown {
  to {
    transform: scaleX(0);
  }
}

.is-saving {
  opacity: 0.62;
}

.is-saved {
  border-color: #67b68e !important;
  box-shadow: 0 0 0 2px rgba(45, 138, 91, 0.1);
}

.whiteboard-view .topbar,
.whiteboard-view .demo-banner,
.whiteboard-view .page-heading,
.whiteboard-view .filter-bar {
  display: none;
}

.whiteboard-view .page-shell {
  max-width: none;
  padding: 5px;
}

.whiteboard-view .metric-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 5px;
}

.whiteboard-view .shift-roster-strip {
  display: flex;
  min-height: 38px;
  margin-bottom: 5px;
  padding: 4px 8px;
  border-radius: 4px;
}

.whiteboard-view .roster-tag {
  min-height: 22px;
  padding: 2px 6px;
  font-size: 0.58rem;
}

.whiteboard-view .roster-tag small {
  font-size: 0.51rem;
}

.whiteboard-view .metric-card {
  min-height: 42px;
  padding: 7px 11px;
  border-radius: 5px;
}

.whiteboard-view .metric-card span {
  font-size: 0.61rem;
}

.whiteboard-view .metric-card strong {
  font-size: 1.35rem;
}

.whiteboard-view .patient-board {
  border-radius: 4px;
}

.whiteboard-view .board-head,
.whiteboard-view .patient-row {
  grid-template-columns: 8px minmax(330px, 2.25fr) 88px 94px 104px minmax(170px, 1fr) 88px minmax(180px, 1.2fr);
}

.whiteboard-view .board-head {
  min-width: 0;
  font-size: 0.56rem;
}

.whiteboard-view .board-head span {
  padding: 5px 7px;
}

.whiteboard-view .board-head span:last-child {
  display: none;
}

.whiteboard-view #patient-rows {
  min-width: 0;
}

.whiteboard-view .patient-row {
  min-height: 42px;
}

.whiteboard-view .patient-cell {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 3px 6px;
}

.whiteboard-view .patient-identity {
  display: grid;
  grid-template-areas:
    "title complaint"
    "workflow workflow";
  grid-template-columns: auto minmax(100px, 1fr);
  align-content: center;
  gap: 2px 7px;
}

.whiteboard-view .patient-title-line {
  grid-area: title;
  flex-wrap: wrap;
  margin: 0;
}

.whiteboard-view .patient-name .inline-edit-trigger,
.whiteboard-view .owner-last-name .inline-edit-trigger {
  font-size: 0.82rem;
  white-space: nowrap;
}

.whiteboard-view .patient-demographics,
.whiteboard-view .notes-preview,
.whiteboard-view .inline-edit-icon,
.whiteboard-view .inline-edit-form,
.whiteboard-view .board-edit-controls,
.whiteboard-view .icon-toggle,
.whiteboard-view .task-toggle,
.whiteboard-view .empty-task,
.whiteboard-view .action-cell {
  display: none !important;
}

.whiteboard-view .inline-edit-trigger {
  pointer-events: none;
}

.whiteboard-view .patient-identity .complaint {
  grid-area: complaint;
  min-width: 0;
}

.whiteboard-view .patient-identity .complaint .inline-edit-trigger {
  overflow: hidden;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whiteboard-view .patient-identity .complaint .inline-edit-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whiteboard-view .priority-badge,
.whiteboard-view .alert-pill {
  min-height: 17px;
  padding: 2px 5px;
  font-size: 0.5rem;
  white-space: nowrap;
}

.whiteboard-view .alert-pill {
  display: inline-flex;
  white-space: normal;
}

.whiteboard-view .patient-title-line .alert-tags {
  max-width: 180px;
  flex-wrap: wrap;
  gap: 2px;
}

.whiteboard-view .workflow-badges {
  grid-area: workflow;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0;
}

.whiteboard-view .workflow-badge {
  min-height: 18px;
  padding: 2px 5px;
  font-size: 0.5rem;
  line-height: 1.15;
  white-space: normal;
}

.whiteboard-view .arrival-cell {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 0;
}

.whiteboard-view .arrival-cell strong,
.whiteboard-view .arrival-cell span {
  font-size: 0.61rem;
  white-space: nowrap;
}

.whiteboard-view .weight-cell {
  justify-content: center;
  color: var(--navy-950);
  background: rgba(255, 255, 255, 0.5);
}

.whiteboard-view .weight-cell strong {
  font-size: 1.08rem;
  font-weight: 950;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.whiteboard-view .new-arrival .arrival-cell strong::after {
  display: none;
}

.whiteboard-view .whiteboard-only {
  display: flex;
}

.whiteboard-view .whiteboard-value {
  min-width: 0;
  flex-direction: column;
  gap: 0;
  color: #37475a;
  font-size: 0.62rem;
  line-height: 1.2;
}

.whiteboard-view .whiteboard-value span {
  color: var(--muted);
  font-size: 0.55rem;
}

.whiteboard-view .team-display {
  display: flex;
  align-content: center;
  flex-wrap: wrap;
  gap: 2px;
  color: #425166;
  font-size: 0.52rem;
  line-height: 1.15;
}

.whiteboard-view .team-display span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  border: 1px solid #d7dfe7;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.72);
  overflow-wrap: anywhere;
}

.whiteboard-view .team-display b {
  color: var(--muted);
  font-size: 0.46rem;
  text-transform: uppercase;
}

.whiteboard-view .task-list {
  width: 100%;
  max-height: 34px;
  gap: 1px;
  overflow: hidden;
}

.whiteboard-view .task-item {
  display: block;
  min-height: 13px;
  overflow: hidden;
  font-size: 0.55rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whiteboard-view .task-item small {
  margin-left: 4px;
  font-size: 0.48rem;
}

.back-link {
  display: inline-flex;
  margin: 4px 0 16px;
  color: var(--navy-700);
  font-size: 0.79rem;
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-hero {
  position: relative;
  display: flex;
  overflow: hidden;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: #fff;
}

.detail-hero::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  content: "";
}

.detail-hero h1 {
  margin-bottom: 6px;
  font-size: 2.45rem;
}

.detail-hero p:not(.eyebrow) {
  margin-bottom: 9px;
  color: var(--muted);
}

.detail-hero > div:first-child > strong {
  color: #39475a;
  font-size: 0.92rem;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.detail-badges .priority-badge,
.detail-badges .alert-pill {
  min-height: 27px;
  padding: 5px 10px;
  font-size: 0.69rem;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--navy-900);
  box-shadow: var(--shadow-sm);
}

.detail-stats > div {
  display: flex;
  min-height: 72px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 13px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.detail-stats > div:last-child {
  border-right: 0;
}

.detail-stats span {
  color: #99a9be;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-stats strong {
  color: #fff;
  font-size: 0.9rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, 0.8fr);
  gap: 15px;
  margin-top: 16px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-heading {
  align-items: center;
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-heading .eyebrow {
  margin-bottom: 4px;
}

.panel-heading > span,
.save-state {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
}

.compact-grid {
  gap: 12px;
}

.compact-grid input,
.compact-grid select,
.compact-grid textarea {
  min-height: 40px;
}

.milestone-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 19px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.task-panel {
  grid-column: 2;
  grid-row: 1;
}

.timeline-panel {
  grid-column: 1 / -1;
}

.detail-task-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.detail-task {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 28px;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}

.detail-task .task-toggle {
  width: 22px;
  height: 22px;
}

.detail-task div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.detail-task strong {
  font-size: 0.77rem;
}

.detail-task span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
}

.detail-task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 145px 30px 32px;
  align-items: center;
  gap: 5px;
  margin-top: 13px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.detail-task-form input,
.detail-task-form select {
  min-height: 36px;
  border-color: transparent;
  font-size: 0.7rem;
}

.detail-task-form input:focus,
.detail-task-form select:focus {
  border-color: #94b3d2;
}

.detail-task-form .task-add-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border-color: #a9bed2;
  color: #17375f;
  background: #edf4fb;
  font-size: 1rem;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}

.timeline-event {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  min-height: 78px;
  padding-bottom: 16px;
}

.timeline-event::before {
  position: absolute;
  top: 15px;
  bottom: -2px;
  left: 6px;
  width: 1px;
  background: #dce3e9;
  content: "";
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  margin-top: 2px;
  border: 3px solid #d8e8fa;
  border-radius: 50%;
  background: var(--blue);
}

.timeline-event strong {
  display: block;
  color: var(--navy-800);
  font-size: 0.78rem;
}

.timeline-event p {
  margin: 3px 0 4px;
  color: #4f5d6e;
  font-size: 0.72rem;
}

.timeline-event small {
  color: #84909f;
  font-size: 0.64rem;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.report-filter-bar {
  grid-template-columns: minmax(170px, 220px) 155px 155px minmax(220px, 290px) auto;
  justify-content: start;
  margin-bottom: 15px;
}

.report-filter-bar label,
.access-form label {
  display: grid;
  gap: 5px;
  color: var(--navy-800);
  font-size: 0.68rem;
  font-weight: 800;
}

.report-filter-bar label > span {
  padding-left: 2px;
}

.access-page {
  display: grid;
  min-height: calc(100vh - 68px);
  place-items: center;
}

.access-card {
  width: min(480px, 100%);
  padding: 32px;
}

.access-card h1 {
  margin-bottom: 10px;
}

.access-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.access-form input,
.access-form select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.configuration-layout {
  display: grid;
  gap: 16px;
}

.config-panel {
  padding: 20px;
}

.panel-intro {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 0.76rem;
}

.date-picker-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 16px 0 12px;
}

.date-picker-form label,
.config-table-row label,
.config-add-form label,
.workload-card label,
.lead-patient-row > label {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.date-picker-form input,
.config-table-row input,
.config-table-row select,
.config-add-form input,
.config-add-form select,
.workload-card select,
.lead-patient-row select,
.lead-task-form input {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-size: 0.72rem;
}

.config-table {
  display: grid;
  gap: 6px;
}

.config-table-row {
  display: grid;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}

.config-table-row > div,
.config-table-row > label:first-of-type {
  min-width: 0;
}

.config-table-row strong,
.config-table-row small {
  display: block;
}

.config-table-row strong {
  color: var(--navy-900);
  font-size: 0.76rem;
}

.config-table-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.61rem;
}

.roster-config-row {
  grid-template-columns: 88px minmax(150px, 1fr) minmax(150px, 230px) 110px 110px 66px;
}

.staff-config-row {
  grid-template-columns: minmax(180px, 1.5fr) 180px 90px 72px;
}

.user-config-row {
  grid-template-columns: minmax(180px, 1.3fr) 180px minmax(170px, 1fr) 80px 72px;
}

.toggle-label {
  display: flex !important;
  align-items: center;
  gap: 6px !important;
  color: #48596c !important;
  white-space: nowrap;
}

.toggle-label input {
  width: 17px;
  min-height: 17px;
  margin: 0;
}

.config-add-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 190px auto;
  align-items: end;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.user-add-form {
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1fr) 170px minmax(180px, 1fr) auto;
}

.lead-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}

.lead-metrics > div {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.lead-metrics span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.lead-metrics strong {
  color: var(--navy-950);
  font-size: 1.7rem;
}

.lead-section {
  margin-bottom: 18px;
}

.lead-section > .panel-heading {
  align-items: center;
}

.lead-view-filter label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
}

.lead-view-filter select {
  min-height: 34px;
  padding: 6px 30px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--navy-800);
  background: #fff;
  font-size: 0.68rem;
  font-weight: 750;
}

.workload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.workload-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.workload-card.is-off-shift {
  border-style: dashed;
  background: #f8fafb;
}

.workload-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.workload-heading strong,
.workload-heading span {
  display: block;
}

.workload-heading strong {
  color: var(--navy-950);
  font-size: 0.88rem;
}

.workload-heading span,
.workload-card > p {
  color: var(--muted);
  font-size: 0.62rem;
}

.workload-heading b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
}

.workload-patients {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.workload-patients a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--navy-800);
  background: var(--blue-soft);
  font-size: 0.67rem;
  font-weight: 800;
  text-decoration: none;
}

.workload-patients small {
  color: var(--muted);
  font-size: 0.53rem;
}

.workload-patients > span {
  color: var(--muted);
  font-size: 0.65rem;
}

.workload-card > p {
  margin: 9px 0 0;
}

.lead-patient-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.lead-patient-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.25fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) minmax(300px, 1.5fr) 64px;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.lead-patient-summary {
  display: grid;
  grid-template-columns: 5px 1fr;
  gap: 9px;
  align-self: stretch;
}

.lead-patient-summary .priority-rail {
  border-radius: 5px;
  background: var(--blue);
}

.lead-patient-row.priority-stat .priority-rail {
  background: var(--coral);
}

.lead-patient-row.priority-urgent .priority-rail {
  background: var(--amber);
}

.lead-patient-row.priority-stable .priority-rail {
  background: var(--teal);
}

.lead-patient-summary strong,
.lead-patient-summary small {
  display: block;
}

.lead-patient-summary strong {
  color: var(--navy-950);
  font-size: 0.84rem;
}

.lead-patient-summary small,
.lead-patient-summary p {
  color: var(--muted);
  font-size: 0.62rem;
}

.lead-patient-summary p {
  margin: 4px 0 0;
}

.lead-task-list {
  display: grid;
  gap: 4px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.lead-task-list li {
  display: grid;
  grid-template-columns: 21px minmax(110px, 1fr) minmax(125px, 0.8fr);
  align-items: center;
  gap: 6px;
}

.lead-task-list li > span {
  overflow: hidden;
  color: #425166;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-task-list select {
  min-height: 28px;
  padding: 4px 22px 4px 6px;
  font-size: 0.62rem;
}

.lead-task-form {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 130px auto 28px;
  gap: 5px;
  margin-top: 6px;
}

.lead-task-form input,
.lead-task-form select {
  min-height: 30px;
  font-size: 0.63rem;
}

.lead-task-form button {
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.access-form .btn {
  min-height: 42px;
}

.access-error {
  margin: 18px 0 -8px;
  padding: 10px 12px;
  border: 1px solid #ebb7bb;
  border-radius: 8px;
  color: #9d2630;
  background: #fff1f2;
  font-size: 0.78rem;
  font-weight: 750;
}

.access-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.report-metrics > div {
  display: flex;
  min-height: 124px;
  flex-direction: column;
  justify-content: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.report-metrics > div > span {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.report-metrics strong {
  margin: 9px 0 5px;
  color: var(--navy-950);
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.report-metrics strong small {
  font-size: 0.75rem;
  letter-spacing: 0;
}

.report-metrics > div > small {
  color: #8994a1;
  font-size: 0.65rem;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(540px, 1.4fr);
  gap: 15px;
}

.pie-chart-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: center;
  margin: 12px 0 15px;
}

.report-pie-chart {
  display: block;
  width: 260px;
  height: 260px;
  cursor: crosshair;
}

.pie-chart-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.pie-chart-tooltip {
  position: absolute;
  z-index: 3;
  max-width: 190px;
  padding: 6px 8px;
  border-radius: 6px;
  color: #fff;
  background: var(--navy-950);
  box-shadow: var(--shadow-sm);
  font-size: 0.64rem;
  font-weight: 800;
  pointer-events: none;
}

.pie-chart-shell.is-empty {
  min-height: 120px;
  grid-template-columns: 1fr;
}

.pie-chart-shell.is-empty canvas {
  display: none;
}

.report-bars {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.report-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 26px;
  align-items: center;
  gap: 10px;
}

.report-bar-row > span {
  overflow: hidden;
  color: #4c5b6d;
  font-size: 0.7rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-bar {
  overflow: hidden;
  height: 9px;
  border-radius: 99px;
  background: #e9eef3;
}

.report-bar i {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #5ba1ed);
}

.report-bar-row strong {
  color: var(--navy-800);
  font-size: 0.75rem;
}

.hour-chart {
  display: grid;
  height: 220px;
  grid-template-columns: repeat(24, minmax(15px, 1fr));
  align-items: end;
  gap: 4px;
  padding-top: 12px;
}

.hour-column {
  display: grid;
  height: 100%;
  grid-template-rows: 16px 1fr 24px;
  align-items: end;
  justify-items: center;
}

.hour-column > span {
  color: #718093;
  font-size: 0.57rem;
  font-weight: 800;
}

.hour-column i {
  display: block;
  width: min(16px, 82%);
  height: max(2px, var(--bar-height));
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--coral), #f08a6b);
  transition: height 250ms ease;
}

.hour-column small {
  color: #7e8996;
  font-size: 0.52rem;
  transform: rotate(-45deg);
  transform-origin: center;
  white-space: nowrap;
}

.report-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.print-view {
  background: #fff;
}

.print-view main {
  max-width: 1500px;
  padding: 24px;
  margin: 0 auto;
}

.print-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--navy-900);
}

.print-heading h1 {
  margin-bottom: 4px;
  font-size: 1.45rem;
}

.print-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.print-view table {
  width: 100%;
  margin-top: 15px;
  border-collapse: collapse;
  font-size: 0.7rem;
}

.print-view th,
.print-view td {
  padding: 8px;
  border: 1px solid #aeb8c2;
  text-align: left;
  vertical-align: top;
}

.print-view th {
  color: #fff;
  background: var(--navy-900);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  align-content: center;
  padding: 30px;
  text-align: center;
}

.error-page .btn {
  margin-top: 12px;
}

.filter-check {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  color: var(--navy-800);
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.filter-check input {
  width: 16px;
  min-height: 16px;
}

.alert-tag-editor {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.alert-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.alert-editor-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 5px 3px 8px;
  border: 1px solid #f0a8af;
  border-radius: 99px;
  color: #9a2631;
  background: #fff0f1;
  font-size: 0.65rem;
  font-weight: 850;
}

.alert-editor-pill button,
.alert-entry-row button {
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: rgba(160, 40, 51, 0.08);
  font-weight: 900;
}

.alert-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 5px;
}

.alert-entry-row input {
  min-height: 32px !important;
}

.alert-color-picker {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #f8fafb;
}

.alert-color-picker .alert-color-option {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: #98a3af;
  box-shadow: none;
}

.alert-color-picker .alert-color-option.alert-green {
  background: #43a77d;
}

.alert-color-picker .alert-color-option.alert-blue {
  background: #4f91d2;
}

.alert-color-picker .alert-color-option.alert-yellow {
  background: #e5ae2f;
}

.alert-color-picker .alert-color-option.alert-red {
  background: #e9505a;
}

.alert-color-picker .alert-color-option.is-selected {
  border-color: #fff;
  outline: 2px solid var(--navy-800);
}

.topbar-notifications {
  position: relative;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  color: #e7eff9;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.66rem;
  font-weight: 800;
}

.notification-count {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: 3px;
  padding: 0 4px;
  place-items: center;
  border-radius: 99px;
  color: #fff;
  background: var(--coral);
  font-size: 0.58rem;
}

.notification-count[hidden] {
  display: none;
}

.notification-center {
  position: fixed;
  z-index: 500;
  top: 0;
  right: 0;
  width: min(410px, 94vw);
  height: 100vh;
  padding: 20px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #f7f9fb;
  box-shadow: -18px 0 48px rgba(16, 34, 61, 0.2);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.notification-center.is-open {
  transform: translateX(0);
}

.notification-center-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.notification-center-heading h2 {
  color: var(--navy-950);
  font-size: 1.35rem;
}

.notification-center-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy-800);
  background: #fff;
  font-size: 1.15rem;
}

.notification-center-help,
.notification-empty {
  margin: 8px 0 15px;
  color: var(--muted);
  font-size: 0.7rem;
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 9px;
  background: #fff;
}

.notification-item.is-persistent {
  box-shadow: inset 0 0 0 1px rgba(17, 35, 63, 0.03);
}

.notification-item.is-info {
  border-left-color: var(--blue);
}

.notification-item.is-alert {
  border-color: #ecd28e;
  border-left-color: #d79611;
  background: #fffbef;
}

.notification-item.is-urgent {
  border-color: #ef9aa2;
  border-left-color: #c92f3d;
  background: #fff6f6;
}

.notification-item.is-error {
  border-color: #df8792;
  border-left-color: #8e2531;
  background: #fff4f5;
}

.notification-item > a,
.notification-item > div {
  color: inherit;
  text-decoration: none;
}

.notification-item strong,
.notification-item p,
.notification-item small {
  display: block;
}

.notification-item strong {
  color: var(--navy-900);
  font-size: 0.76rem;
}

.notification-item p {
  margin: 3px 0 6px;
  color: #4d5b6d;
  font-size: 0.7rem;
  line-height: 1.4;
}

.notification-item small {
  color: var(--muted);
  font-size: 0.6rem;
}

.notification-item > button {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #f8fafb;
  font-weight: 900;
}

.notification-scrim {
  position: fixed;
  z-index: 490;
  inset: 0;
  background: rgba(9, 23, 41, 0.35);
}

.whiteboard-exit {
  display: none;
}

.whiteboard-view .whiteboard-exit {
  position: fixed;
  z-index: 600;
  top: 7px;
  right: 7px;
  display: grid;
  width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(17, 35, 63, 0.35);
  border-radius: 6px;
  color: #fff;
  background: rgba(17, 35, 63, 0.8);
  font-size: 0.88rem;
  font-weight: 850;
  opacity: 0.4;
}

.whiteboard-view .whiteboard-exit:hover,
.whiteboard-view .whiteboard-exit:focus-visible {
  opacity: 1;
}

.staff-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
}

.staff-report-table th,
.staff-report-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.staff-report-table th {
  color: var(--muted);
  font-size: 0.59rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.staff-report-table a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.report-staff-name {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.report-color-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border: 1px solid rgba(17, 35, 63, 0.18);
  border-radius: 50%;
  background: #9aa6b5;
  box-shadow: 0 0 0 2px #fff;
}

.report-table-scroll {
  overflow-x: auto;
}

.report-workload-table {
  max-height: 380px;
  overflow-y: auto;
  border-top: 1px solid var(--line-soft);
}

.report-workload-table .staff-report-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #fff;
}

@media (max-width: 1250px) {
  .topbar {
    padding: 0 18px;
  }

  .live-status {
    display: none;
  }

  .page-shell {
    padding-right: 18px;
    padding-left: 18px;
  }

  .patient-board {
    overflow-x: auto;
  }

  .filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .search-field {
    grid-column: span 2;
  }

  .report-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .lead-patient-row {
    grid-template-columns: minmax(210px, 1fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr);
  }

  .lead-task-block {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .topbar {
    position: relative;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .brand {
    min-width: 0;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 3;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .main-nav a {
    min-height: 38px;
    padding: 0 11px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .actor-form label {
    display: none;
  }

  .access-status-form > span,
  .access-signin {
    display: none;
  }

  .access-status-form {
    padding-left: 0;
    border-left: 0;
  }

  .sync-banner {
    top: 0;
  }

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

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

  .filter-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .patient-board {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .board-head {
    display: none;
  }

  #patient-rows {
    min-width: 0;
  }

  .patient-row {
    display: grid;
    min-width: 0;
    grid-template-columns: 8px repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
  }

  .priority-rail {
    grid-row: 1 / 6;
    border-radius: var(--radius) 0 0 var(--radius);
  }

  .patient-cell {
    position: relative;
    padding-top: 29px;
    border-bottom: 1px solid var(--line-soft);
  }

  .patient-cell::before {
    position: absolute;
    top: 10px;
    left: 11px;
    color: #8994a2;
    content: attr(data-label);
    font-size: 0.58rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .patient-identity,
  .task-cell {
    grid-column: 2 / -1;
  }

  .arrival-cell {
    grid-column: 2;
  }

  .action-cell {
    grid-column: 2 / -1;
    flex-direction: row;
  }

  .action-cell > * {
    flex: 1;
  }

  .detail-layout,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .task-panel,
  .timeline-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .detail-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-stats > div:nth-child(2) {
    border-right: 0;
  }

  .detail-stats > div:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

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

  .report-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .lead-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .roster-config-row,
  .staff-config-row,
  .user-config-row,
  .config-add-form,
  .user-add-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .lead-patient-summary,
  .lead-task-block {
    grid-column: 1 / -1;
  }
}

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

  .topbar-actions {
    grid-row: 2;
    justify-content: flex-start;
  }

  .main-nav {
    grid-row: 3;
  }

  .actor-form select {
    width: min(210px, 55vw);
  }

  .page-shell {
    padding: 17px 10px 40px;
  }

  .report-filter-bar {
    grid-template-columns: 1fr;
  }

  .access-card {
    padding: 24px 20px;
  }

  .lead-metrics,
  .roster-config-row,
  .staff-config-row,
  .user-config-row,
  .config-add-form,
  .user-add-form,
  .lead-patient-row {
    grid-template-columns: 1fr;
  }

  .lead-patient-summary,
  .lead-task-block {
    grid-column: 1;
  }

  .lead-task-list li,
  .lead-task-form {
    grid-template-columns: 24px 1fr;
  }

  .lead-task-list select,
  .lead-task-form select {
    grid-column: 2;
  }

  .page-heading {
    margin-top: 15px;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions .btn {
    flex: 1;
  }

  .metric-grid {
    gap: 7px;
  }

  .metric-card {
    min-height: 67px;
    padding: 11px 13px;
  }

  .metric-card span {
    font-size: 0.61rem;
  }

  .metric-card strong {
    font-size: 1.5rem;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: 1;
  }

  .patient-row {
    grid-template-columns: 8px 1fr;
  }

  .priority-rail {
    grid-row: 1 / 8;
  }

  .patient-cell,
  .patient-identity,
  .task-cell,
  .arrival-cell,
  .action-cell {
    grid-column: 2;
  }

  .action-cell {
    flex-wrap: wrap;
  }

  .form-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: 1;
  }

  .detail-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .detail-hero h1 {
    font-size: 2rem;
  }

  .detail-stats {
    grid-template-columns: 1fr;
  }

  .detail-stats > div {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .detail-stats > div:last-child {
    border-bottom: 0;
  }

  .detail-task-form {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .detail-task-form > input[name="description"] {
    grid-column: 1 / -1;
  }

  .report-metrics {
    grid-template-columns: 1fr;
  }

  .report-metrics > div {
    min-height: 100px;
  }

  .wide-report {
    overflow-x: auto;
  }

  .hour-chart {
    min-width: 660px;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 0.35in;
  }

  .print-heading button {
    display: none;
  }

  .print-view main {
    max-width: none;
    padding: 0;
  }

  .print-view table {
    font-size: 8pt;
  }

  .print-view tr {
    break-inside: avoid;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast-countdown {
    display: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
