/* ============================================================
   ECHO · Nurse Dashboard — Claymorphism Design System
   Light medical palette · Google Sans + Google Sans typography
   ============================================================ */

/* ────────────────────────────────────────────
   APP SHELL
   ──────────────────────────────────────────── */

.n-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ────────────────────────────────────────────
   TOP NAVIGATION BAR
   ──────────────────────────────────────────── */

.n-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  row-gap: 7px;
  flex-wrap: wrap;
  padding: calc(10px + var(--safe-t)) 18px 10px;
}
/* (was flex-wrap: nowrap + overflow-x: auto with the scrollbar hidden, which
   pushed the last actions past the right edge on phones behind an invisible
   scroll. Wrapping only happens when the row is crowded — desktop keeps its
   single-line bar.) */

/* Icon-only topbar buttons (utility actions): square, calm, tooltipped.
   40px minimum box everywhere, 44px on touch / hybrid devices — a 20px-wide
   bare icon is untappable on a bedside tablet (44px is the accessibility
   floor). Labelled .btn-sm buttons keep a min-HEIGHT floor only: a min-WIDTH
   floor would override the flex content floor and let tight toolbars squeeze
   them until the nowrap label clips. */
.n-top .btn-ic { padding: 7px 10px; gap: 0; min-width: 40px; min-height: 40px; justify-content: center; }
.n-top .btn-ic .ic { width: 17px; height: 17px; }
.n-top .btn-sm { min-height: 40px; }
@media (hover: none) {
  .n-top .btn-ic { min-width: 44px; min-height: 44px; }
  .n-top .btn-sm { min-height: 44px; }
}
/* Touch screens without hover (phones, tablets) get the same 44px floor —
   including filter pills, which aren't .btn and would otherwise sit at ~31px.
   Roster remove/refresh also lift from their hover:none sizes here so
   touch-capable laptops (hover:hover + coarse) stay tappable too. */
@media (pointer: coarse) {
  .n-top .btn-ic { min-width: 44px; min-height: 44px; }
  .n-top .btn-sm { min-height: 44px; min-width: 44px; }
  .filter-pill,
  .patient-pill { min-height: 44px; }
  .patient-status-refresh { min-width: 44px; min-height: 44px; }
  .patient-card-item { grid-template-columns: minmax(0, 1fr) 44px; }
  .patient-card-item .btn-rm-patient { width: 44px; height: 44px; }
  .patient-card-item .btn-ask-patient { min-height: 44px; }
}
.n-top-label-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
/* Labels hidden progressively: primary actions keep labels until narrow */
@media (max-width: 1250px) {
  .n-top-label { display: none; }
  /* With the label gone these are icon-only actions: center the icon and keep
     a 44px square floor so they never collapse into a 20px tap sliver or clip. */
  .n-top .btn-sm { min-width: 44px; justify-content: center; gap: 0; padding-left: 12px; padding-right: 12px; }
}

/* Brand logo */
.n-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  margin-right: 2px;
}
.n-brand .brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(160deg, #eef8ff, #dceeff);
  box-shadow:
    var(--clay-sm),
    inset 1px 1px 2px rgba(255,255,255,.85),
    inset -1px -2px 3px rgba(37,77,112,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.n-brand .brand-mark .ic { width: 96%; height: 96%; object-fit: contain; }
.n-logo-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}
.n-brand .dash-word {
  color: var(--chrome-ink-soft);
  font-weight: 600;
  font-size: 13px;
}

/* Responsive top bar */
@media (max-width: 900px) {
  .n-top { gap: 6px; padding: calc(8px + var(--safe-t)) 12px 8px; }
  .n-brand .dash-word { display: none; }
  .n-top .badge { font-size: 12px; padding: 3px 9px; }
  .n-top .btn-sm { padding: 5px 9px; font-size: 12px; min-height: 40px; }
}
@media (max-width: 600px) {
  .n-logo-word { font-size: 15px; }
}

/* ────────────────────────────────────────────
   NURSE IDENTITY CHIP
   ──────────────────────────────────────────── */

.nurse-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.72);
  box-shadow: var(--clay-sm);
  border-radius: 999px;
  padding: 4px 10px 4px 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  max-width: 220px;
  cursor: pointer;
  transition: box-shadow .15s ease, transform .1s ease;
  flex-shrink: 0;
}
.nurse-chip:hover { box-shadow: var(--clay-raised); transform: translateY(-1px); }
.nurse-chip:focus-visible { outline: 2px solid rgba(255, 253, 248, .85); outline-offset: 3px; }
.nurse-chip .nurse-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3f7f76, #2f6f66);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: inset 1px 1px 2px rgba(255,255,255,0.4);
}
.nurse-chip .nurse-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}
.nurse-chip .nurse-name {
  font-weight: 800;
  color: var(--text);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nurse-chip .nurse-unit {
  font-size: 11.5px;
  color: var(--text-soft);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ────────────────────────────────────────────
   LAYOUT — Main content
   ──────────────────────────────────────────── */

.n-main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 18px 60px;
}
@media (max-width: 520px) {
  .n-main { padding: 14px 16px calc(76px + var(--safe-b)); }
}

/* ────────────────────────────────────────────
   TWO-COLUMN FEED LAYOUT (feed + side rail)
   ──────────────────────────────────────────── */

.n-cols {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  align-items: start;
  margin-top: 6px;
}
@media (max-width: 880px) {
  .n-cols { grid-template-columns: 1fr; }
}

/* ────────────────────────────────────────────
   SETUP / JOIN CARD
   ──────────────────────────────────────────── */

.join-card {
  max-width: 500px;
  margin: 5vh auto 0;
  display: grid;
  gap: 14px;
}
.join-card h1 {
  font-family: var(--font-display);
  margin: 0;
  font-size: clamp(23px, 5vw, 27px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.015em;
}
.join-card .hint {
  color: var(--text-soft);
  font-size: 14px;
  margin: 0;
  line-height: 1.55;
}
.join-card input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  box-shadow: var(--clay-pressed);
  color: var(--text);
}
/* Room-code field keeps the wide, centered, spaced style */
.join-card input#inInitialRooms {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 6px;
  text-transform: uppercase;
}
.join-card input#inInitialRooms::placeholder { color: var(--text-faint); letter-spacing: 6px; }
.join-err {
  color: #a63a3a;
  background: var(--alert-soft);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
}

/* ────────────────────────────────────────────
   REQUEST FEED
   ──────────────────────────────────────────── */

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.feed-head h2 {
  font-family: var(--font-display);
  margin: 0;
  font-size: clamp(20px, 4vw, 23px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
}

.feed-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* Filter pills (urgency: All / Emergencies / Active / Handled) */
.filter-pill {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: var(--clay-sm);
  color: var(--text-soft);
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-pill:hover { color: var(--text); transform: translateY(-1px); }
.filter-pill:active { transform: translateY(1px); box-shadow: var(--clay-pressed); }
.filter-pill:focus-visible { outline: 3px solid rgba(37, 77, 112, .55); outline-offset: 2px; }
.filter-pill.active {
  background: linear-gradient(145deg, #35658e, #254d70);
  color: #fff;
  border-color: rgba(255,255,255,.35);
  box-shadow: 4px 6px 12px rgba(37,77,112,.25);
}
.filter-pill.emg-pill.active {
  background: linear-gradient(145deg, #dd6161, #bd4848);
  box-shadow: 4px 6px 12px rgba(184,68,68,.3);
}

.feed { display: grid; gap: 14px; }

/* ────────────────────────────────────────────
   PENDING YES/NO QUESTIONS
   A question asked from this dashboard stays visible above the feed until
   the patient's blink answer arrives. Amber once it has waited too long.
   ──────────────────────────────────────────── */

.pending-q-list { display: grid; gap: 10px; margin-bottom: 14px; }
.pending-q-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #f3fbf8, #e5f5f0);
  border: 1px solid rgba(255, 255, 255, .7);
  border-left: 6px solid var(--accent);
  box-shadow: var(--clay-sm);
  animation: risein .3s cubic-bezier(.2, .9, .3, 1.08) backwards;
  word-break: break-word;
}
.pending-q-card.is-late {
  background: linear-gradient(145deg, #fffaf1, #fbeed9);
  border-left-color: var(--warn);
}
.pending-q-stamp {
  width: 44px; height: 44px;
  flex: none;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--teal-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, .8),
    inset -1px -2px 3px rgba(29, 63, 92, .12);
}
.pending-q-card.is-late .pending-q-stamp { background: #fbeed9; color: #8a5a12; }
.pending-q-stamp .ic { width: 23px; height: 23px; }
.pending-q-bd { min-width: 0; }
.pending-q-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.pending-q-text {
  margin: 4px 0 0;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}
.pending-q-meta {
  margin: 5px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-faint);
  line-height: 1.45;
}
.pending-q-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 520px) {
  .pending-q-card { padding: 12px 14px; gap: 11px; grid-template-columns: 38px minmax(0, 1fr); }
  .pending-q-stamp { width: 38px; height: 38px; border-radius: 12px; }
  .pending-q-stamp .ic { width: 20px; height: 20px; }
  .pending-q-text { font-size: 15px; }
  .pending-q-acts .btn { flex: 1 1 auto; }
}

/* Individual request card */
.req {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: var(--clay-shadow);
  animation: risein .3s cubic-bezier(.2, .9, .3, 1.08) backwards;
  animation-delay: var(--d, 0ms);
  word-break: break-word;
}
@media (max-width: 520px) {
  .req { padding: 13px 14px; gap: 11px; }
  .req .stamp { width: 38px; height: 38px; border-radius: 12px; }
  .req .stamp .ic { width: 20px; height: 20px; }
  .req .who { font-size: 14.5px; }
  .req .msg { font-size: 14.5px; }
  .req .acts .btn { flex: 1 1 auto; font-size: 13px; }
}
@keyframes risein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.req .stamp {
  width: 44px; height: 44px;
  flex: none;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--teal-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,.8),
    inset -1px -2px 3px rgba(29,63,92,.12);
}
.req .stamp .ic { width: 23px; height: 23px; }
.req .bd { flex: 1; min-width: 0; }
.req .who { font-weight: 800; font-size: 15.5px; letter-spacing: .01em; }
.req .bedtag {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 10px;
  box-shadow: var(--clay-sm);
}
.req .roomtag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-faint);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 8px;
}
.req .msg { color: var(--text); font-size: 15.5px; margin-top: 3px; line-height: 1.45; }
.req .drawing {
  display: block;
  width: 100%;
  max-width: 460px;
  margin-top: 9px;
  border-radius: 14px;
  border: 1px solid var(--line, #e2e7f0);
  background: #fff;
  box-shadow: 0 6px 16px rgba(23, 35, 58, .08);
}
.req .when { color: var(--text-faint); font-size: 12px; margin-top: 7px; font-weight: 600; letter-spacing: .02em; }
.req .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Emergency request card variant */
.req.emg .stamp { background: var(--alert-soft); color: #a63a3a; }
.req.emg { border-left: 6px solid var(--alert); }
.req.emg .who { color: #a63a3a; }

/* "How urgent is it?" severity chip + amber accent for medium-urgency requests */
.lvl-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 9px; vertical-align: 1px; flex-shrink: 0;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.18);
}
.lvl-dot.low { background: var(--ok); }
.lvl-dot.med { background: var(--warn); }
.req.lvl-med { border-left: 6px solid var(--warn); }

/* Pulsing animation for unacknowledged new requests */
.req.speaks { animation: risein .22s ease-out, breath 2.2s ease-in-out infinite; }
@keyframes breath {
  0%, 100% { box-shadow: var(--clay-shadow); }
  50%       { box-shadow: var(--clay-shadow), 0 0 0 5px rgba(37,77,112,.14); }
}

/* Dimmed for handled requests */
.req.done { opacity: .55; }

/* Hover lift + press feedback on request cards (pointer devices only).
   Cards are not buttons, so the lift is subtler and the tilt layer stays in charge of 3D. */
@media (hover: hover) {
  .article-hover-anim.req:hover, article[data-cmid]:hover {
    transform: translateY(-3px);
    box-shadow: 10px 14px 26px rgba(37, 77, 112, .18), -6px -6px 14px rgba(255, 255, 255, .75);
    transition: transform .16s cubic-bezier(.2, .9, .3, 1.35), box-shadow .18s ease;
  }
  article[data-cmid]:active { transform: translateY(0) scale(.995); transition-duration: .07s; }
}

/* Feed action buttons: explicit press-down that beats the hover lift */
.req .acts .btn:active { transform: translateY(1px) scale(.98); box-shadow: var(--clay-pressed); }

/* ────────────────────────────────────────────
   SIDE RAIL (left sidebar within the n-cols grid)
   ──────────────────────────────────────────── */

.rail { display: grid; gap: 16px; }
.rail h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 15.5px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .005em;
}
.patient-list { display: grid; gap: 10px; }

/* Empty state */
.empty {
  color: var(--text-faint);
  font-size: 14px;
  padding: 24px 18px;
  text-align: center;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  line-height: 1.6;
  background: rgba(255,255,255,.35);
}

/* ────────────────────────────────────────────
   PATIENT RAIL HEAD + PATIENT CARD ITEMS (mini sidebar list)
   ──────────────────────────────────────────── */

.patient-card-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  align-items: start;
  gap: 6px 8px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: var(--radius-md);
  box-shadow: var(--clay-sm);
  padding: 12px;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  position: relative;
  word-break: break-word;
}
.patient-card-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--clay-raised);
}
.patient-card-item:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.patient-card-item.selected {
  border-color: var(--clay-deep);
  background: linear-gradient(145deg, #f4fbf8, #e2f4ef);
  box-shadow: var(--clay-raised);
}
.patient-card-item .patient-card-focus {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.patient-card-item .patient-card-focus:focus-visible { outline: none; }
.patient-card-item .patient-card-focus:active { transform: translateY(1px) scale(.995); }
.patient-card-item .p-card-top { display: flex; min-width: 0; }
.patient-card-item .p-meta { flex: 1; min-width: 0; }
.patient-card-item .p-title {
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.patient-card-item .p-sub {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
  font-weight: 600;
  line-height: 1.35;
}
.patient-card-item .p-bed {
  font-size: 11px;
  padding: 1px 6px;
}
.patient-card-item .p-room-label {
  background: var(--accent-soft);
  color: var(--teal-ink);
}
.patient-card-item .btn-rm-patient {
  width: 26px; height: 26px;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all .15s ease;
  font-size: 16px;
  line-height: 1;
}
.patient-card-item .btn-rm-patient .ic { width: 13px; height: 13px; }
.patient-card-item .btn-rm-patient:hover {
  background: var(--alert-soft);
  color: var(--alert);
}
/* Ask-the-patient button (yes/no question answered with eye blinks) */
.patient-card-item .btn-ask-patient {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: stretch;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--teal-ink);
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
}
.patient-card-item .btn-ask-patient .ic { width: 15px; height: 15px; flex: 0 0 auto; }
.patient-card-item .btn-ask-patient:hover {
  background: var(--clay-soft);
  color: var(--teal-ink);
  border-color: var(--clay-deep);
}
.patient-card-item .btn-ask-patient:focus-visible {
  outline: 2px solid var(--teal-ink);
  outline-offset: 2px;
}
.patient-card-item .btn-ask-patient:active {
  transform: translateY(1px);
}

/* Ask-question dialog (free text + preset chips) */
.ask-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px;
}
.ask-chip {
  border: 1px solid rgba(255,255,255,.7); background: var(--surface-2);
  box-shadow: var(--clay-sm); border-radius: 999px; padding: 10px 15px;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--text-soft); cursor: pointer;
}
.ask-chip:hover { border-color: var(--accent); color: var(--teal-ink); }
#askQInput {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.7); background: var(--surface-2);
  box-shadow: var(--clay-pressed); font: inherit; font-size: 15px; font-weight: 600;
  color: var(--text);
}
#askQInput:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.dlg-sub { color: var(--text-soft); font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; }

/* ────────────────────────────────────────────
   PATIENT FILTER PILLS (above feed)
   ──────────────────────────────────────────── */

.patient-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.patient-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-soft);
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.patient-pill:hover { color: var(--text); border-color: var(--line-strong); }
.patient-pill:active { transform: translateY(1px); box-shadow: var(--clay-pressed); }
.filter-pill:active, .patient-pill:active { transition-duration: .06s; }
.patient-pill.active {
  background: var(--accent-soft);
  color: var(--teal-ink);
  border-color: var(--clay-deep);
  box-shadow: var(--clay-sm);
}

/* ────────────────────────────────────────────
   NURSE PROFILES SWITCHER LIST
   ──────────────────────────────────────────── */

.nurse-profiles-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
  max-height: 230px;
  overflow-y: auto;
}
.nurse-profile-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--clay-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all .12s ease;
}
.nurse-profile-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--surface);
}
.nurse-profile-card:active {
  transform: translateY(1px) scale(.995);
  box-shadow: var(--clay-pressed);
  transition-duration: .06s;
}
.nurse-profile-card.active {
  border-color: var(--clay-deep);
  background: var(--accent-soft);
}

/* ────────────────────────────────────────────
   PATIENT ROSTER — combined identity and request status
   ──────────────────────────────────────────── */

.patient-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.patient-status-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.005em;
  color: var(--text);
}
.patient-status-nurse {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-soft);
  margin-top: 3px;
  line-height: 1.3;
}
.patient-status-summary {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-soft);
  letter-spacing: .02em;
  text-align: right;
  line-height: 1.3;
}
.patient-roster-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}
.patient-status-refresh {
  min-width: 38px;
  min-height: 38px;
}
@media (hover: none) {
  .patient-status-refresh { min-width: 44px; min-height: 44px; }
  .patient-card-item { grid-template-columns: minmax(0, 1fr) 44px; }
  .patient-card-item .btn-rm-patient { width: 44px; height: 44px; }
  .patient-card-item .btn-ask-patient { min-height: 44px; }
}
.patient-card-item .p-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  grid-column: 1 / -1;
}
.patient-card-item .p-stat {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.patient-card-item .p-stat.open-stat {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--teal-ink);
}
.patient-card-item .p-stat.emergency-stat {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--alert-soft);
  color: var(--alert);
}
.patient-card-item.has-emg {
  border-color: var(--alert);
  background: linear-gradient(145deg, #fdf1f1, #fbe3e3);
  animation: emg-pulse 1.6s ease-in-out infinite;
}
@keyframes emg-pulse {
  0%, 100% { box-shadow: var(--clay-sm); }
  50%       { box-shadow: var(--clay-sm), 0 0 0 4px rgba(212,84,84,.18); }
}

/* Small status labels are also used in the online-patient picker. */
.ps-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}
.ps-stat.online-stat { color: var(--ok); }
.ps-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
}
.ps-dot.on {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(74,157,111,.22);
}

@media (max-width: 440px) {
  .patient-status-head { flex-wrap: wrap; }
  .patient-roster-tools {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .patient-status-summary { text-align: left; }
}

/* ────────────────────────────────────────────
   BROWSE PATIENT ROWS (in connect dialog)
   ──────────────────────────────────────────── */

.browse-patient-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface-2);
  margin-bottom: 6px;
  transition: all .12s ease;
}
.browse-patient-row:hover {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateY(-1px);
}
.browse-patient-row:has(input:checked) {
  border-color: var(--clay-deep);
  background: var(--accent-soft);
  box-shadow: var(--clay-sm);
}

/* ────────────────────────────────────────────
   EMERGENCY ALARM OVERLAY
   ──────────────────────────────────────────── */

.alarm-ov {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 38%, rgba(212,84,84,.28), rgba(52,62,66,.55));
  backdrop-filter: blur(4px);
  padding: 16px;
}
.alarm-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 30px;
  padding: 34px 36px;
  text-align: center;
  max-width: 92vw;
  width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--clay-raised), 0 0 0 8px rgba(212,84,84,.16);
  animation: apulse 1.4s ease-in-out infinite;
}
@keyframes apulse {
  0%, 100% { box-shadow: var(--clay-raised), 0 0 0 8px rgba(212,84,84,.16); }
  50%       { box-shadow: var(--clay-raised), 0 0 0 22px rgba(212,84,84,.07); }
}
.alarm-card .stamp {
  width: 84px; height: 84px;
  margin: 0 auto;
  border-radius: 26px;
  background: linear-gradient(145deg, #dd6161, #bd4848);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    8px 10px 18px rgba(184,68,68,.35),
    inset 1px 2px 3px rgba(255,255,255,.4),
    inset -2px -3px 5px rgba(120,38,38,.3);
}
.alarm-card .stamp .ic { width: 44px; height: 44px; }
.alarm-card h2 {
  font-family: var(--font-display);
  margin: 16px 0 4px;
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 700;
  line-height: 1.07;
  color: #a63a3a;
  letter-spacing: .025em;
}
.alarm-card .who { font-family: var(--font-display); font-size: clamp(18px, 4vw, 24px); font-weight: 700; }
.alarm-card .sub { color: var(--text-soft); margin-top: 8px; font-size: 14.5px; }
.alarm-card .act { margin-top: 22px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 560px) {
  .alarm-card { padding: 24px 18px; border-radius: 22px; }
  .alarm-card h2 { font-size: 22px; }
  .alarm-card .who { font-size: 18px; }
  .alarm-card .act { flex-direction: column; }
  .alarm-card .act .btn { width: 100%; }
}

/* ────────────────────────────────────────────
   END-OF-SHIFT SUMMARY (printable)
   ──────────────────────────────────────────── */

.shift-sum-ov {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 16px;
  overflow: auto;
  background: rgba(26, 38, 48, .45);
  backdrop-filter: blur(4px);
}
.shift-sum {
  width: min(920px, 100%);
  background: #fffdf8;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px rgba(18, 33, 49, .3);
  padding: 22px 26px 24px;
}
.shift-sum-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.shift-sum-tools-title { display: grid; gap: 2px; margin-right: auto; }
.shift-sum-tools-title b { font-family: var(--font-display); font-size: 17px; color: var(--text); }
.shift-sum-tools-title span { font-size: 12px; font-weight: 600; color: var(--text-faint); }
.shift-sum-window {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-soft);
}
.shift-sum-window select {
  font: inherit;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.shift-sum-actions { display: flex; gap: 8px; }

.shift-sum-head { margin-bottom: 18px; }
.shift-sum-kicker {
  margin: 0;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.shift-sum-head h1 {
  font-family: var(--font-display);
  margin: 4px 0 2px;
  font-size: 28px;
  line-height: 1.1;
  color: var(--text);
}
.shift-sum-sub { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.shift-sum-generated { margin: 3px 0 0; font-size: 12px; font-weight: 600; color: var(--text-faint); }

.shift-sum-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.sum-kpi {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  padding: 10px 12px;
  display: grid;
  gap: 2px;
}
.sum-kpi b { font-family: var(--font-display); font-size: 22px; line-height: 1.1; color: var(--text); }
.sum-kpi span {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.sum-kpi.is-warn { border-color: #e5c07b; background: #fffaf0; }
.sum-kpi.is-warn b { color: #8a5a12; }
.sum-kpi.is-alert { border-color: #e0a0a0; background: #fdf2f2; }
.sum-kpi.is-alert b { color: #a63a3a; }

.shift-sum-section { margin-bottom: 18px; }
.shift-sum-section h2 { font-family: var(--font-display); margin: 0 0 8px; font-size: 16px; color: var(--text); }
.sum-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sum-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 7px 10px;
  border-bottom: 1.5px solid var(--line-strong);
  white-space: nowrap;
}
.sum-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: top; }
.sum-table tbody tr:nth-child(even) td { background: rgba(37, 77, 112, .03); }
.sum-table td:first-child { font-weight: 700; }
.sum-table .sum-msg { max-width: 320px; }
.sum-table .sum-empty { color: var(--text-faint); font-style: italic; font-weight: 600; }

.shift-sum-foot { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.shift-sum-foot p { margin: 0 0 4px; font-size: 11.5px; line-height: 1.5; color: var(--text-faint); font-weight: 600; }

@media (max-width: 720px) {
  .shift-sum { padding: 18px 16px 20px; }
  .shift-sum-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sum-table { font-size: 12px; }
  .sum-table th, .sum-table td { padding: 6px 7px; }
}

/* ────────────────────────────────────────────
   PRINT
   ──────────────────────────────────────────── */

@media print {
  .n-top, dialog, .ack, .alarm-ov { display: none !important; }

  /* While the summary preview is open, print only the summary. */
  body.summary-print .n-app { display: none !important; }
  body.summary-print .shift-sum-ov {
    position: static;
    display: block;
    padding: 0;
    overflow: visible;
    background: #fff;
    backdrop-filter: none;
  }
  body.summary-print .shift-sum {
    width: auto;
    max-width: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    color: #111;
  }
  body.summary-print .shift-sum-tools { display: none !important; }
  body.summary-print .shift-sum-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body.summary-print .sum-kpi,
  body.summary-print .sum-table th,
  body.summary-print .sum-table td { background: #fff !important; border-color: #bbb; color: #111; }
  body.summary-print .sum-kpi b,
  body.summary-print .shift-sum-head h1 { color: #111; }
  body.summary-print .shift-sum-kicker,
  body.summary-print .shift-sum-sub,
  body.summary-print .shift-sum-generated,
  body.summary-print .sum-kpi span,
  body.summary-print .shift-sum-foot p { color: #444; }
  body.summary-print .shift-sum tr { break-inside: avoid; }
  body.summary-print .shift-sum-section { break-inside: auto; }
  @page { margin: 14mm; }
}
