/* =========================================================
   MediAlert В· "Lavender" theme
   Visual layer inspired by a soft pastel dashboard layout:
   gradient canvas, floating white frame, violet accents,
   large rounded cards and pastel metric tiles.
   Loaded after styles.css вЂ” overrides the original design.
   ========================================================= */

:root {
  /* accent + neutrals */
  --blue-800: #4c2fc4;
  --blue-700: #5b3ce0;
  --blue-600: #6f4bf6;
  --blue-500: #8b6cff;
  --blue-300: #c3b2ff;
  --blue-100: #e9e1ff;
  --blue-50: #f4f0ff;

  --bg: #faf8ff;
  --surface: #ffffff;
  --surface-soft: #fbf9ff;
  --surface-muted: #f6f2fd;
  --text: #171122;
  --text-secondary: #3f3752;
  --muted: #8b83a0;
  --subtle: #a99fbd;
  --line: #f2edf9;
  --line-strong: #e6ddf3;

  --red-700: #c41f47;
  --red-600: #ef4368;
  --red-100: #ffe3e9;
  --red-50: #fff1f5;
  --yellow-700: #b06a12;
  --yellow-600: #f2a03d;
  --yellow-100: #ffe9cd;
  --yellow-50: #fff8ee;
  --green-700: #0b7f5e;
  --green-600: #12b886;
  --green-100: #d9f7ec;
  --green-50: #eefbf6;

  --pink: #ff6a9d;
  --pink-soft: #ffe7f1;
  --mint: #0fbf9a;
  --mint-soft: #ddf8f0;
  --amber: #f2a03d;
  --amber-soft: #ffefdb;

  --shadow-xs: 0 1px 2px rgba(52, 30, 102, 0.04);
  --shadow-sm: 0 10px 28px -18px rgba(70, 40, 150, 0.28), 0 1px 2px rgba(52, 30, 102, 0.04);
  --shadow-md: 0 24px 50px -30px rgba(70, 40, 150, 0.4);
  --shadow-lg: 0 50px 90px -50px rgba(58, 32, 130, 0.55);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --sidebar-width: 240px;
  --topbar-height: 82px;
  --transition: 170ms cubic-bezier(0.22, 0.7, 0.3, 1);

  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-sans: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

/* ============ Canvas ============ */
body {
  background: #f6f1ff;
  color: var(--text);
  font-size: 14px;
  letter-spacing: -0.005em;
}

body::before {
  position: fixed;
  z-index: -2;
  inset: 0;
  content: "";
  background:
    radial-gradient(760px 520px at 6% -6%, #e7d6ff 0%, rgba(231, 214, 255, 0) 58%),
    radial-gradient(680px 480px at 100% -4%, #ffe0ef 0%, rgba(255, 224, 239, 0) 55%),
    radial-gradient(820px 620px at 92% 104%, #ffdcec 0%, rgba(255, 220, 236, 0) 58%),
    linear-gradient(158deg, #f2e9ff 0%, #f9f3ff 46%, #fdeef8 100%);
  pointer-events: none;
}

body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.32) 0,
    rgba(255, 255, 255, 0.32) 1px,
    rgba(255, 255, 255, 0) 1px,
    rgba(255, 255, 255, 0) 148px
  );
  mix-blend-mode: soft-light;
  pointer-events: none;
}

::selection {
  color: #fff;
  background: var(--blue-600);
}

:focus-visible {
  outline: 2px solid rgba(111, 75, 246, 0.65);
  outline-offset: 3px;
}

/* ============ Shell frame ============ */
.app-shell {
  min-height: 100vh;
  padding: 16px;
}

.sidebar {
  top: 16px;
  bottom: 16px;
  left: 16px;
  width: var(--sidebar-width);
  padding: 20px 14px 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(120, 87, 220, 0.05);
}

.sidebar::after {
  display: none;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 32px);
  margin: 0 0 0 calc(var(--sidebar-width) + 24px);
  overflow: visible;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(120, 87, 220, 0.05);
}

.view {
  flex: 1;
  max-width: 1560px;
  padding: 26px 30px 34px;
  background: linear-gradient(180deg, #ffffff 0%, #fdfbff 58%, #fdfaff 100%);
  border-radius: 0 0 28px 28px;
}

/* ============ Sidebar ============ */
.sidebar__brand {
  padding: 2px 6px 18px;
}

.brand {
  gap: 10px;
}

.brand-mark {
  color: #fff;
  background: linear-gradient(145deg, #8a68ff 0%, #6134f0 78%);
  border: 0;
  border-radius: 13px;
  box-shadow: 0 10px 20px -8px rgba(101, 58, 240, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand__copy strong {
  color: var(--text);
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: -0.45px;
}

.brand__copy small {
  margin-top: 2px;
  color: #b3a8c8;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.facility-context {
  margin: 0 2px 18px;
  padding: 10px 11px;
  background: linear-gradient(135deg, #f8f4ff, #fdf7ff);
  border: 1px solid #f0e8fc;
  border-radius: 15px;
}

.facility-context__icon {
  width: 32px;
  height: 32px;
  color: var(--blue-600);
  background: #ede5ff;
  border-radius: 10px;
}

.facility-context__copy strong {
  color: #2b2340;
  font-size: 11.5px;
  font-weight: 650;
}

.facility-context__copy small {
  color: #a096b6;
  font-size: 9px;
}

.demo-tag {
  color: #7a5ff0;
  font-size: 7.5px;
  letter-spacing: 0.1em;
  background: #efe8ff;
  border: 1px solid #e3d8ff;
  border-radius: 5px;
}

.nav-group + .nav-group {
  margin-top: 18px;
}

.nav-group--system {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #f4effa;
}

.nav-group__label {
  padding: 0 12px 7px;
  color: #b6abca;
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.15em;
}

.nav-item {
  height: 42px;
  gap: 11px;
  padding: 0 12px;
  color: #6b6280;
  font-size: 12.8px;
  font-weight: 550;
  border: 0;
  border-radius: 13px;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.nav-item + .nav-item {
  margin-top: 3px;
}

.nav-item:hover {
  color: #2b2340;
  background: #f8f4ff;
}

.nav-item.is-active {
  color: #fff;
  background: linear-gradient(135deg, #8a68ff 0%, #6a3ff2 100%);
  box-shadow: 0 14px 24px -14px rgba(106, 63, 242, 0.9);
}

.nav-item.is-active::before {
  display: none;
}

.nav-item__icon {
  width: 20px;
  color: #b1a6c7;
}

.nav-item.is-active .nav-item__icon {
  color: #fff;
}

.nav-badge {
  min-width: 20px;
  height: 20px;
  color: #6a3ff2;
  font-size: 9.5px;
  background: #f0e9ff;
  border-radius: 7px;
}

.nav-item.is-active .nav-badge {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.nav-badge--blue {
  color: #3f6ff0;
  background: #e8efff;
}

.nav-item.is-active .nav-badge--blue {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.nav-badge--alert {
  min-width: 19px;
  color: #fff;
  background: var(--red-600);
}

.nav-role-label {
  color: #b3a8c8;
  font-size: 8px;
}

.sidebar__bottom {
  padding: 14px 2px 0;
  border-top: 1px solid #f4effa;
}

.sidebar-status {
  padding: 0 8px 10px;
}

.sidebar-status__dot {
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(15, 191, 154, 0.12);
}

.sidebar-status.is-offline .sidebar-status__dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(242, 160, 61, 0.14);
}

.sidebar-status strong {
  color: #6b6280;
  font-size: 9.5px;
}

.sidebar-status small {
  color: #b6abca;
  font-size: 8.5px;
}

.sidebar-status.is-offline strong {
  color: #b06a12;
}

/* SQLite fallback: the app works, but writes are not going to PostgreSQL. */
.sidebar-status.is-fallback .sidebar-status__dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(242, 160, 61, 0.14);
}

.sidebar-status.is-fallback strong {
  color: #b06a12;
}

.sidebar-user {
  padding: 9px;
  background: #f9f5ff;
  border: 1px solid #f1e9fc;
  border-radius: 15px;
}

.sidebar-user:hover {
  background: #f4eeff;
  border-color: #e6dbf9;
}

.avatar {
  color: #5b3ce0;
  font-weight: 700;
  background: linear-gradient(145deg, #f4efff, #e8ddff);
  border: 1px solid #e4d8fb;
}

.avatar--sidebar {
  color: #fff;
  background: linear-gradient(145deg, #8a68ff, #6236ef);
  border-color: transparent;
}

.avatar--soft {
  color: #6b6280;
  background: #f7f3fc;
  border-color: #efe8f9;
}

.avatar--staff {
  color: #5b3ce0;
  background: linear-gradient(145deg, #f6f1ff, #ece2ff);
}

.avatar--lg {
  border-radius: 18px;
}

.sidebar-user__copy strong {
  color: #2b2340;
  font-size: 11.5px;
  font-weight: 650;
}

.sidebar-user__copy small {
  color: #a89dbd;
  font-size: 8.5px;
}

.sidebar-user > svg {
  color: #bfb4d2;
}

.sidebar-footnote {
  color: #c0b6d1;
  font-size: 8px;
}

/* ============ Topbar ============ */
.topbar {
  height: var(--topbar-height);
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid #f5f0fb;
  border-radius: 28px 28px 0 0;
  backdrop-filter: blur(18px) saturate(1.2);
}

.breadcrumbs {
  gap: 7px;
  color: #b0a6c4;
  font-size: 11px;
}

.breadcrumbs svg {
  color: #cfc6de;
}

.breadcrumbs strong {
  color: #2b2340;
  font-size: 12px;
  font-weight: 650;
}

.global-search {
  width: 268px;
  height: 42px;
  padding: 0 13px;
  gap: 9px;
  background: #f7f3fd;
  border: 1px solid #f2ecfa;
  border-radius: 13px;
  color: #a79dbb;
}

.global-search:focus-within {
  background: #fff;
  border-color: #d9c9fa;
  box-shadow: 0 0 0 4px rgba(111, 75, 246, 0.08);
}

.global-search input {
  font-size: 12px;
  color: #2b2340;
}

.global-search input::placeholder {
  color: #b3a9c6;
}

.global-search kbd {
  padding: 3px 6px;
  color: #a79dbb;
  font-size: 8.5px;
  font-weight: 650;
  background: #fff;
  border: 1px solid #f0eaf9;
  border-radius: 6px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #6b6280;
  background: #fff;
  border: 1px solid #f2ecfa;
  border-radius: 13px;
  box-shadow: 0 6px 14px -12px rgba(70, 40, 150, 0.5);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.icon-button:hover {
  color: #3f2a8f;
  background: #faf7ff;
  border-color: #e9e0f8;
}

.icon-button--small {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  box-shadow: none;
}

.notification-trigger {
  position: relative;
}

.notification-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  color: #fff;
  font-size: 8.5px;
  font-weight: 750;
  background: linear-gradient(135deg, #ff7fac, #f0446b);
  border: 2px solid #fff;
  border-radius: 99px;
}

.topbar-clock {
  min-width: 88px;
  gap: 1px;
  text-align: right;
}

.topbar-clock strong {
  color: #171122;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.topbar-clock span {
  color: #ada2c0;
  font-size: 8.5px;
}

.ambulance-mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  color: #b42347;
  font-size: 10px;
  font-weight: 650;
  background: #fff1f5;
  border: 1px solid #ffdde7;
  border-radius: 99px;
}

.ambulance-mode i {
  width: 6px;
  height: 6px;
  background: var(--red-600);
  border-radius: 50%;
}

/* ============ Buttons ============ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  gap: 7px;
  padding: 0 17px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  border-radius: 13px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  color: #fff;
  background: #171122;
  border-color: #171122;
  box-shadow: 0 14px 24px -16px rgba(23, 17, 34, 0.9);
}

.button--primary:hover {
  background: #2b203f;
  border-color: #2b203f;
  box-shadow: 0 16px 28px -14px rgba(23, 17, 34, 0.8);
}

.button--secondary {
  color: #3f3752;
  background: #fff;
  border-color: #f0eaf9;
  box-shadow: 0 6px 14px -12px rgba(70, 40, 150, 0.45);
}

.button--secondary:hover {
  background: #fbf8ff;
  border-color: #e5dafb;
}

.button--ghost {
  color: #6b6280;
  background: transparent;
  border-color: transparent;
}

.button--ghost:hover {
  color: #2b2340;
  background: #f8f4ff;
}

.button--danger {
  color: #fff;
  background: linear-gradient(135deg, #ff6f92, #e9305c);
  border-color: transparent;
  box-shadow: 0 14px 24px -16px rgba(233, 48, 92, 0.9);
}

.button--danger:hover {
  filter: brightness(1.03);
}

.button--danger-ghost {
  color: #c41f47;
  background: #fff5f8;
  border-color: #ffdce6;
}

.button--danger-ghost:hover {
  background: #ffeef3;
}

.button--small {
  height: 32px;
  padding: 0 12px;
  font-size: 10.5px;
  border-radius: 10px;
}

.button--topbar {
  height: 42px;
  padding: 0 18px;
  border-radius: 13px;
}

.button--large {
  height: 46px;
  padding: 0 22px;
  border-radius: 15px;
}

.button:disabled,
.button--disabled {
  opacity: 0.5;
  box-shadow: none;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  color: #6f4bf6;
  font-size: 10.5px;
  font-weight: 650;
  background: none;
  border: 0;
  border-radius: 8px;
}

.text-button:hover {
  color: #4c2fc4;
}

.text-button--muted {
  color: #9a90ae;
}

/* ============ Page heading ============ */
.page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.page-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: #a79dbb;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.eyebrow-divider {
  width: 3px;
  height: 3px;
  background: #cfc5e0;
  border-radius: 50%;
}

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0b7f5e;
  font-size: 10px;
  font-weight: 650;
}

.live-label i {
  width: 6px;
  height: 6px;
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(15, 191, 154, 0.14);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(15, 191, 154, 0.14);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(15, 191, 154, 0.06);
  }
}

.page-heading h1 {
  margin-top: 6px;
  color: #171122;
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -1.1px;
  line-height: 1.12;
}

.page-heading p {
  margin-top: 6px;
  max-width: 640px;
  color: #958aa9;
  font-size: 12px;
  line-height: 1.5;
}

.shift-pill {
  display: flex;
  align-items: center;
  flex: none;
  gap: 10px;
  padding: 10px 15px 10px 11px;
  background: #fff;
  border: 1px solid #f2ecfa;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.shift-pill__icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #6f4bf6;
  background: #f1ebff;
  border-radius: 11px;
}

.shift-pill strong {
  display: block;
  color: #2b2340;
  font-size: 11.5px;
  font-weight: 650;
}

.shift-pill small {
  color: #a79dbb;
  font-size: 9.5px;
}

/* ============ Critical banner ============ */
.critical-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 18px;
  overflow: hidden;
  background: linear-gradient(105deg, #fff2f6 0%, #fff6fa 46%, #fff 100%);
  border: 1px solid #ffdfe8;
  border-radius: 20px;
  box-shadow: 0 18px 36px -30px rgba(239, 67, 104, 0.65);
  transition: transform var(--transition), box-shadow var(--transition);
}

.critical-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 42px -28px rgba(239, 67, 104, 0.55);
}

.critical-banner::after {
  position: absolute;
  right: -40px;
  top: -60px;
  width: 220px;
  height: 220px;
  content: "";
  background: radial-gradient(circle, rgba(255, 122, 158, 0.16), transparent 66%);
  border-radius: 50%;
}

.critical-banner__icon {
  display: grid;
  flex: none;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #e9305c;
  background: #ffe1e9;
  border-radius: 14px;
}

.critical-banner__copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.critical-banner__eyebrow {
  color: #d62a55;
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.critical-banner__copy strong {
  color: #2b1220;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.25px;
}

.critical-banner__copy > span:last-child {
  overflow: hidden;
  color: #a06a7d;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.critical-banner__meta {
  display: flex;
  align-items: center;
  flex: none;
  gap: 12px;
}

.critical-attention {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  color: #d62a55;
  font-size: 9.5px;
  font-weight: 650;
  background: #ffe6ed;
  border-radius: 999px;
}

.critical-banner__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #2b1220;
  font-size: 10px;
  font-weight: 650;
}

/* ============ Dashboard hero ============ */
.dash-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 2px 2px 0;
}

.dash-hero__eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: #a79dbb;
  font-size: 10.5px;
  font-weight: 550;
}

.dash-hero h1 {
  margin-top: 8px;
  color: #171122;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1.1;
}

.dash-hero__sub {
  margin-top: 6px;
  max-width: 560px;
  color: #988daa;
  font-size: 12px;
}

.dash-hero__side {
  display: flex;
  align-items: center;
  flex: none;
  gap: 10px;
}

.hero-shift {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px 7px 8px;
  background: #fff;
  border: 1px solid #f3edfa;
  border-radius: 14px;
  box-shadow: 0 10px 20px -20px rgba(70, 40, 150, 0.6);
}

.hero-shift__icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #6f4bf6;
  background: #f2ecff;
  border-radius: 10px;
}

.hero-shift strong {
  display: block;
  color: #2b2340;
  font-size: 10.5px;
  font-weight: 650;
}

.hero-shift small {
  display: block;
  margin-top: 1px;
  color: #ada2c0;
  font-size: 8.5px;
}

.hero-bell {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #6b6280;
  background: #fff;
  border: 1px solid #f3edfa;
  border-radius: 14px;
  box-shadow: 0 10px 20px -20px rgba(70, 40, 150, 0.6);
}

.hero-bell:hover {
  color: #4c2fc4;
  background: #fbf8ff;
}

.hero-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 5px;
  background: #fff;
  border: 1px solid #f3edfa;
  border-radius: 16px;
  box-shadow: 0 10px 20px -20px rgba(70, 40, 150, 0.6);
}

.hero-user:hover {
  border-color: #e8dcfb;
  background: #fdfaff;
}

.hero-user .avatar {
  width: 36px;
  height: 36px;
  color: #fff;
  background: linear-gradient(145deg, #8a68ff, #6134f0);
  border: 0;
  border-radius: 12px;
  font-size: 10.5px;
}

.hero-user__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}

.hero-user__copy strong {
  color: #2b2340;
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.hero-user__copy small {
  color: #ada2c0;
  font-size: 8.5px;
}

.hero-user > svg {
  color: #c3b8d6;
}

/* ============ Stats ============ */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 148px;
  padding: 16px 17px 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #f4eefa;
  border-radius: 20px;
  box-shadow: 0 18px 34px -30px rgba(76, 44, 150, 0.55);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.stat-card:hover {
  border-color: #ebdffb;
  box-shadow: 0 24px 40px -30px rgba(76, 44, 150, 0.6);
  transform: translateY(-2px);
}

.stat-card::before {
  display: none;
}

.stat-card::after {
  position: absolute;
  right: -46px;
  top: -58px;
  width: 130px;
  height: 130px;
  content: "";
  background: radial-gradient(circle, rgba(111, 75, 246, 0.06), transparent 68%);
  border-radius: 50%;
}

.stat-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #6f4bf6;
  background: #f1ebff;
  border: 0;
  border-radius: 13px;
}

.stat-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  color: #0b7f5e;
  font-size: 9px;
  font-weight: 700;
  background: #e9faf3;
  border-radius: 999px;
}

.stat-delta--rose {
  color: #c41f47;
  background: #ffe9ef;
}

.stat-delta--amber {
  color: #b06a12;
  background: #fff2df;
}

.stat-delta--violet {
  color: #5b3ce0;
  background: #f0e9ff;
}

.stat-badge {
  padding: 4px 8px;
  color: #7a6f90;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #f8f4ff;
  border: 1px solid #f2ecfa;
  border-radius: 999px;
}

.stat-card__label {
  margin-top: 12px;
  color: #9a90ae;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.stat-card__value {
  margin-top: 3px;
  color: #171122;
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.4px;
  line-height: 1;
}

.stat-card__value small {
  color: #b3a9c6;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.stat-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  color: #ada2c0;
  font-size: 9px;
  line-height: 1.35;
}

.stat-card__foot > span:first-child {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 4px;
}

.stat-link {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 1px;
  color: #8b7aa8;
  font-weight: 650;
}

.stat-alert {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 4px;
  color: #c41f47;
  font-weight: 650;
}

.capacity-mini {
  width: 52px;
  height: 4px;
  overflow: hidden;
  background: #f2ecf9;
  border-radius: 99px;
}

.capacity-mini i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8a68ff, #6a3ff2);
  border-radius: inherit;
}

/* tone variants */
.stat-card--violet .stat-icon {
  color: #6f4bf6;
  background: #f1ebff;
}

.stat-card--rose .stat-icon {
  color: #e9305c;
  background: #ffe9ef;
}

.stat-card--amber .stat-icon {
  color: #d9821f;
  background: #ffefdb;
}

.stat-card--mint .stat-icon {
  color: #0b9c7c;
  background: #e1f9f1;
}

.stat-card--rose {
  background: linear-gradient(180deg, #fffafc 0%, #fff 52%);
}

.stat-card--rose::after {
  background: radial-gradient(circle, rgba(239, 67, 104, 0.07), transparent 68%);
}

/* ============ Dashboard grid ============ */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(320px, 0.86fr);
  gap: 16px;
  align-items: start;
}

.dash-grid--bottom {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
}

.dash-grid--flow {
  align-items: stretch;
}

.dash-grid--flow .chart-card {
  display: flex;
  flex-direction: column;
}

.dash-grid--flow .chart-card .chart-body {
  display: flex;
  flex: 1;
  align-items: center;
}

.dash-grid--flow .chart-card .chart-legend {
  margin-top: auto;
}

.dash-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ============ Chart card ============ */
.chart-card {
  min-width: 0;
  overflow: hidden;
}

.chart-card .card-heading {
  align-items: center;
  padding: 19px 22px 6px;
}

.chart-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  background: #f8f4ff;
  border: 1px solid #f4eefb;
  border-radius: 999px;
}

.chart-tab {
  height: 28px;
  padding: 0 12px;
  color: #9a90ae;
  font-size: 9.5px;
  font-weight: 650;
  background: transparent;
  border: 0;
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}

.chart-tab:hover {
  color: #3f3752;
}

.chart-tab.is-active {
  color: #fff;
  background: #171122;
  box-shadow: 0 8px 14px -10px rgba(23, 17, 34, 0.9);
}

.chart-summary {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 8px 22px 0;
}

.chart-summary strong {
  color: #171122;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  line-height: 1;
}

.chart-summary span {
  padding-bottom: 2px;
  color: #a79dbb;
  font-size: 9.5px;
}

.chart-summary em {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 1px;
  padding: 3px 7px;
  color: #0b7f5e;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 700;
  background: #e9faf3;
  border-radius: 999px;
}

.chart-body {
  padding: 4px 10px 0;
}

.flow-chart {
  display: block;
  width: 100%;
  height: auto;
}

.flow-grid line {
  stroke: #f2edf9;
  stroke-dasharray: 3 6;
  stroke-width: 1;
}

.flow-axis {
  fill: #b6abc9;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
}

.flow-area {
  fill: url(#flowFill);
}

.flow-line {
  fill: none;
  stroke: #7a53f7;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-line--ambulance {
  stroke: #ff7aa8;
  stroke-width: 2.2;
  stroke-dasharray: 5 6;
}

.flow-dot {
  fill: #fff;
  stroke: #7a53f7;
  stroke-width: 2.4;
}

.flow-dot--ambulance {
  stroke: #ff7aa8;
}

.flow-highlight {
  fill: rgba(122, 83, 247, 0.07);
  stroke: rgba(122, 83, 247, 0.16);
  stroke-dasharray: 3 5;
}

.flow-tooltip rect {
  fill: #171122;
  filter: drop-shadow(0 8px 16px rgba(23, 17, 34, 0.28));
}

.flow-tooltip text {
  fill: #fff;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 650;
}

.chart-card[data-series="ambulance"] .flow-area {
  opacity: 0.25;
}

.chart-card[data-series="ambulance"] .flow-line:not(.flow-line--ambulance) {
  opacity: 0.18;
}

.chart-card[data-series="ambulance"] .flow-dot:not(.flow-dot--ambulance) {
  opacity: 0.2;
}

.chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 4px 22px 0;
  padding: 12px 0 16px;
  border-top: 1px solid #f5f0fb;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8b81a0;
  font-size: 9.5px;
  font-weight: 600;
}

.chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7a53f7;
}

.chart-legend i.is-ambulance {
  background: #ff7aa8;
}

.chart-legend b {
  color: #2b2340;
  font-weight: 700;
}

.chart-legend small {
  margin-left: auto;
  color: #b3a9c6;
  font-size: 8.5px;
}

/* ============ Incoming card ============ */
.incoming-card {
  overflow: hidden;
}

.incoming-card .card-heading {
  padding: 18px 20px 10px;
}

.incoming-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
}

.incoming-item {
  padding: 12px 13px;
  background: #fff;
  border: 1px solid #f5f0fb;
  border-radius: 16px;
  box-shadow: 0 8px 20px -22px rgba(76, 44, 150, 0.6);
}

.incoming-item--red {
  background: linear-gradient(150deg, #fff6f9, #fff 58%);
  border-color: #ffe0e9;
}

.incoming-item--yellow {
  background: linear-gradient(150deg, #fffbf3, #fff 58%);
  border-color: #ffedd2;
}

.incoming-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ambulance-id {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6b6280;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.ambulance-id svg {
  color: #9a90ae;
}

.eta-badge {
  padding: 4px 8px;
  color: #5b3ce0;
  font-size: 8.5px;
  font-weight: 700;
  background: #f0e9ff;
  border-radius: 999px;
}

.incoming-item__person {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
}

.incoming-item__person > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.incoming-item__person strong {
  color: #221a33;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.15px;
}

.incoming-item__person span {
  overflow: hidden;
  color: #a294b0;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-vitals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.mini-vitals > span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 8px;
  background: #fbf9ff;
  border: 1px solid #f6f1fc;
  border-radius: 10px;
}

.mini-vitals small {
  color: #b0a5c2;
  font-size: 8px;
  font-weight: 600;
}

.mini-vitals strong {
  color: #2b2340;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mini-vitals .is-critical strong {
  color: #d62a55;
}

.incoming-item__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed #f3edf9;
}

.incoming-item__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.prealert-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #7a708e;
  font-size: 8.5px;
  font-weight: 600;
}

.prealert-status__dot {
  width: 6px;
  height: 6px;
  background: #b3a9c6;
  border-radius: 50%;
}

.prealert-status--received {
  color: #3f6ff0;
}

.prealert-status--received .prealert-status__dot {
  background: #3f6ff0;
}

.prealert-status--notified {
  color: #0b7f5e;
}

.prealert-status--notified .prealert-status__dot {
  background: var(--mint);
}

.compact-empty {
  padding: 26px 16px;
  color: #a79dbb;
  font-size: 10.5px;
  text-align: center;
  background: #fbf9ff;
  border: 1px dashed #efe6f9;
  border-radius: 16px;
}

.incoming-card .card-link {
  padding: 12px;
  color: #6f4bf6;
  font-size: 10px;
  font-weight: 650;
  border-top: 1px solid #f5f0fb;
}

.incoming-card .card-link:hover {
  background: #fcf9ff;
}

/* ============ Cards ============ */
.card {
  background: #fff;
  border: 1px solid #f4eefa;
  border-radius: 22px;
  box-shadow: 0 18px 40px -36px rgba(76, 44, 150, 0.55), 0 1px 2px rgba(52, 30, 102, 0.02);
}

.card-heading {
  gap: 14px;
  padding: 19px 22px 14px;
}

.card-heading h2 {
  color: #171122;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.card-heading p {
  margin-top: 4px;
  color: #a79dbb;
  font-size: 9.5px;
  line-height: 1.45;
}

.card-title-line {
  gap: 8px;
}

.count-badge {
  min-width: 22px;
  height: 21px;
  padding: 0 7px;
  color: #7a6f90;
  font-size: 9px;
  font-weight: 700;
  background: #f8f4ff;
  border: 1px solid #f4eefb;
  border-radius: 7px;
}

.count-badge--navy {
  color: #fff;
  background: #171122;
  border-color: #171122;
}

.card-muted {
  color: #b3a9c6;
  font-size: 9px;
}

.card-link {
  padding: 12px 22px;
  color: #6f4bf6;
  font-size: 10px;
  font-weight: 650;
  border-top: 1px solid #f5f0fb;
}

.card-link:hover {
  color: #4c2fc4;
  background: #fcf9ff;
}

.card-footer-note {
  padding: 12px 22px;
  color: #b3a9c6;
  font-size: 8.5px;
  border-top: 1px solid #f5f0fb;
}

.card-footer-note a {
  color: #6f4bf6;
  font-weight: 650;
}

/* ============ Table / patients ============ */
.patients-card {
  overflow: hidden;
}

.card-heading--table {
  align-items: center;
  padding-bottom: 12px;
}

.table-toolbar {
  gap: 12px;
  padding: 0 20px 14px;
}

.filter-chips {
  gap: 3px;
  padding: 4px;
  background: #f8f4ff;
  border: 1px solid #f4eefb;
  border-radius: 999px;
}

.filter-chip {
  height: 28px;
  padding: 0 11px;
  gap: 5px;
  color: #8b81a0;
  font-size: 9.5px;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 999px;
}

.filter-chip:hover {
  color: #3f3752;
  background: #fff;
}

.filter-chip.is-active {
  color: #fff;
  background: #171122;
  box-shadow: 0 8px 14px -10px rgba(23, 17, 34, 0.9);
}

.filter-chip span {
  color: #b3a9c6;
  font-size: 8.5px;
  font-weight: 700;
}

.filter-chip.is-active span {
  color: rgba(255, 255, 255, 0.62);
}

.filter-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.table-search {
  width: 200px;
  height: 34px;
  padding: 0 11px;
  gap: 7px;
  color: #ada2c0;
  background: #f8f4ff;
  border: 1px solid #f4eefb;
  border-radius: 11px;
}

.table-search:focus-within {
  background: #fff;
  border-color: #dccbfb;
  box-shadow: 0 0 0 4px rgba(111, 75, 246, 0.07);
}

.table-search input {
  font-size: 10.5px;
  color: #2b2340;
}

.table-search input::placeholder {
  color: #b6abc9;
}

.patient-table {
  border-top: 1px solid #f7f2fc;
}

.dashboard-page .patient-table__head,
.dashboard-page .patient-row {
  padding: 0 22px;
}

.patient-table__head {
  height: 34px;
  color: #b3a9c6;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: #fdfbff;
  border-bottom: 1px solid #f8f3fd;
}

.dashboard-page .patient-table__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 372px;
  padding: 4px 10px 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ded2f3 transparent;
}

.dashboard-page .patient-table__body::-webkit-scrollbar {
  width: 6px;
}

.dashboard-page .patient-table__body::-webkit-scrollbar-thumb {
  background: #e3d9f5;
  border-radius: 99px;
}

.dashboard-page .patient-table__body::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-page .patient-table__head,
.dashboard-page .patient-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.7fr) 108px 118px 92px minmax(150px, 1.1fr) 20px;
  align-items: center;
  gap: 12px;
}

.dashboard-page .patient-table__head {
  padding-left: 12px;
  padding-right: 12px;
}

.patient-row {
  min-height: 58px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.patient-row:hover {
  background: #fbf8ff;
  border-color: #f4edfd;
}

.patient-row:focus-visible {
  background: #fbf8ff;
  border-color: #e3d5fb;
}

.patient-cell--person {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.patient-cell__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.patient-cell__copy strong {
  overflow: hidden;
  color: #221a33;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-cell__copy span {
  overflow: hidden;
  color: #a79dbb;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-cell__copy span i {
  color: #cfc5df;
  font-style: normal;
}

.patient-row .avatar {
  width: 34px;
  height: 34px;
  font-size: 9.5px;
  border-radius: 12px;
}

.patient-cell--priority {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.patient-cell--time {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.patient-cell--time strong {
  color: #2b2340;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.patient-cell--time span {
  color: #b3a9c6;
  font-size: 8.5px;
}

.patient-cell--team {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.team-avatar {
  display: grid;
  flex: none;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #5b3ce0;
  font-size: 7.5px;
  font-weight: 750;
  background: #f1ebff;
  border-radius: 9px;
}

.team-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.team-names strong {
  overflow: hidden;
  color: #3f3752;
  font-size: 9.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-names small {
  overflow: hidden;
  color: #b3a9c6;
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-unassigned {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #b06a12;
  font-size: 9px;
  font-weight: 600;
}

.patient-row__chevron {
  display: grid;
  place-items: center;
  color: #d3c8e4;
}

.mini-flag {
  padding: 2px 6px;
  color: #b06a12;
  font-size: 7.5px;
  font-weight: 700;
  background: #fff2df;
  border-radius: 999px;
}

/* badges */
.triage-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 999px;
}

.triage-badge__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.triage-badge--red {
  color: #c41f47;
  background: #ffe6ed;
}

.triage-badge--yellow {
  color: #b06a12;
  background: #fff0d9;
}

.triage-badge--green {
  color: #0b7f5e;
  background: #e3faf1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  color: #7a6f90;
  font-size: 8.5px;
  font-weight: 650;
  background: #f7f3fc;
  border: 0;
  border-radius: 999px;
  white-space: nowrap;
}

.status-badge--blue {
  color: #4c2fc4;
  background: #f0e9ff;
}

.status-badge--neutral {
  color: #7a6f90;
  background: #f7f3fc;
}

.status-badge--muted {
  color: #b3a9c6;
  background: #faf7fd;
}

.status-badge--critical,
.status-badge--danger {
  color: #c41f47;
  background: #ffe9ef;
}

.table-empty {
  padding: 34px 20px;
  color: #a79dbb;
  text-align: center;
}

.table-empty strong {
  color: #3f3752;
  font-size: 12px;
}

.table-empty span {
  font-size: 10px;
}

/* ============ Team / duty card ============ */
.team-card {
  overflow: hidden;
}

.team-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 14px 12px;
  padding: 22px 18px 18px;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255, 255, 255, 0.6), transparent 60%),
    linear-gradient(160deg, #f4edff 0%, #fdf3fb 100%);
  border: 1px solid #f2e8fd;
  border-radius: 20px;
}

.team-profile__avatar {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(145deg, #9a7bff, #6134f0);
  border: 3px solid #fff;
  border-radius: 22px;
  box-shadow: 0 16px 26px -16px rgba(97, 52, 240, 0.85);
}

.team-profile strong {
  margin-top: 10px;
  color: #221a33;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.team-profile__role {
  margin-top: 3px;
  color: #9a8fae;
  font-size: 9.5px;
}

.team-profile__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 9px;
  color: #5b3ce0;
  font-size: 8.5px;
  font-weight: 700;
  background: #fff;
  border: 1px solid #efe6fd;
  border-radius: 999px;
}

.team-profile__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 8px;
  margin-top: 14px;
}

.team-profile__stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
}

.team-profile__stats strong {
  margin: 0;
  color: #221a33;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.6px;
}

.team-profile__stats span {
  color: #a79dbb;
  font-size: 8.5px;
}

.team-profile .button {
  width: 100%;
  margin-top: 12px;
  height: 36px;
  font-size: 10px;
  border-radius: 12px;
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 14px 14px;
}

.team-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 12px;
}

.team-row:hover {
  background: #fbf8ff;
}

.team-row .avatar {
  width: 30px;
  height: 30px;
  font-size: 8px;
  border-radius: 10px;
}

.team-row__copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.team-row__copy strong {
  color: #3f3752;
  font-size: 10px;
  font-weight: 650;
}

.team-row__copy span {
  color: #b3a9c6;
  font-size: 8.5px;
}

.team-row__load {
  display: flex;
  align-items: center;
  gap: 7px;
}

.progress {
  width: 56px;
  height: 4px;
  overflow: hidden;
  background: #f2ecf9;
  border-radius: 99px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #a98cff, #6a3ff2);
  border-radius: inherit;
}

.progress--blue span {
  background: linear-gradient(90deg, #8a68ff, #6134f0);
}

.team-row__pct {
  width: 26px;
  color: #8b81a0;
  font-size: 8.5px;
  font-weight: 650;
  text-align: right;
}

/* ============ Activity ============ */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 10px;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 13px;
  transition: background var(--transition);
}

.activity-row:hover:not(:disabled) {
  background: #fbf8ff;
}

.activity-row__icon {
  display: grid;
  flex: none;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #6f4bf6;
  background: #f3edff;
  border-radius: 11px;
}

.activity-row__icon.is-critical {
  color: #e9305c;
  background: #ffe9ef;
}

.activity-row__copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.activity-row__copy strong {
  overflow: hidden;
  color: #2b2340;
  font-size: 10.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-row__copy span {
  overflow: hidden;
  color: #a79dbb;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-row__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
  gap: 1px;
}

.activity-row__meta span {
  color: #8b81a0;
  font-size: 8.5px;
  font-weight: 600;
}

.activity-row__meta small {
  color: #c3b8d6;
  font-size: 8px;
}

/* ============ Capacity ============ */
.capacity-overview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 22px 14px;
}

.capacity-ring {
  position: relative;
  display: grid;
  flex: none;
  width: 88px;
  height: 88px;
  place-items: center;
  background: conic-gradient(#7a53f7 var(--capacity-angle, 120deg), #f3edfb 0);
  border-radius: 50%;
}

.capacity-ring::after {
  position: absolute;
  inset: 8px;
  content: "";
  background: #fff;
  border-radius: 50%;
}

.capacity-ring > div {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.capacity-ring strong {
  color: #171122;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}

.capacity-ring span {
  color: #b3a9c6;
  font-size: 8px;
}

.capacity-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.capacity-copy strong {
  color: #2b2340;
  font-size: 11.5px;
  font-weight: 700;
}

.capacity-copy p {
  color: #a79dbb;
  font-size: 9.5px;
  line-height: 1.45;
}

.capacity-critical {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: #c41f47;
  font-size: 8.5px;
  font-weight: 650;
}

.zone-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 22px 18px;
}

.zone-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8b81a0;
  font-size: 9.5px;
}

.zone-row > span {
  width: 74px;
  flex: none;
}

.zone-dots {
  display: flex;
  flex: 1;
  gap: 3px;
}

.zone-dots i {
  flex: 1;
  height: 5px;
  background: #e9e1f5;
  border-radius: 99px;
}

.zone-dots i.is-free {
  background: linear-gradient(90deg, #8a68ff, #6a3ff2);
}

.zone-row strong {
  color: #3f3752;
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ============ Generic page grids ============ */
.patient-detail-grid,
.resources-layout,
.ambulance-layout,
.hospital-ambulance-layout,
.assistant-layout,
.patients-layout {
  gap: 16px;
}

/* ============ Forms ============ */
.field__label {
  color: #6b6280;
  font-size: 9.5px;
  font-weight: 650;
}

.field__label small {
  color: #b3a9c6;
  font-size: 8.5px;
}

.field input,
.field select,
.field textarea {
  color: #221a33;
  background: #fbf9ff;
  border: 1px solid #f1eaf9;
  border-radius: 11px;
  font-size: 11.5px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  background: #fff;
  border-color: #d8c5fa;
  box-shadow: 0 0 0 4px rgba(111, 75, 246, 0.08);
  outline: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b6abc9;
}

.field__hint {
  color: #ada2c0;
  font-size: 8.5px;
}

.field__error {
  color: #c41f47;
  font-size: 8.5px;
}

.input-unit > span {
  color: #a79dbb;
  font-size: 9px;
  background: #f7f3fd;
  border-color: #f1eaf9;
}

/* ============ Modals ============ */
.modal-backdrop {
  background: rgba(28, 18, 48, 0.4);
  backdrop-filter: blur(6px);
}

.modal {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  box-shadow: 0 60px 120px -50px rgba(30, 15, 60, 0.6);
}

.modal__header {
  padding: 22px 24px 14px;
  border-bottom: 1px solid #f7f2fc;
}

.modal__heading h2 {
  color: #171122;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.modal__heading p {
  color: #a79dbb;
  font-size: 10px;
}

.modal__body {
  padding: 20px 24px;
}

.modal__footer {
  padding: 14px 24px 20px;
  background: #fdfbff;
  border-top: 1px solid #f7f2fc;
  border-radius: 0 0 26px 26px;
}

.modal__close {
  color: #9a90ae;
  background: #f8f4ff;
  border: 1px solid #f3edfb;
  border-radius: 11px;
}

.modal__close:hover {
  color: #3f3752;
  background: #f3ecff;
}

.modal-section h4 {
  color: #6b6280;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.modal-lead {
  color: #8b81a0;
  font-size: 11px;
  line-height: 1.55;
}

/* ============ Toasts ============ */
.toast {
  color: #fff;
  background: #211a33;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 30px 50px -30px rgba(20, 10, 40, 0.8);
}

.toast--success {
  background: linear-gradient(135deg, #0f9d78, #0b7f5e);
}

.toast--error {
  background: linear-gradient(135deg, #f0446b, #cf2249);
}

.toast__body strong {
  font-size: 11px;
}

.toast__body span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 9.5px;
}

/* ============ Form feedback ============ */
.form-error-summary {
  margin-bottom: 14px;
  padding: 12px 14px;
  color: #a3253f;
  font-size: 10.5px;
  line-height: 1.5;
  background: #fff3f6;
  border: 1px solid #ffd9e2;
  border-radius: 14px;
}

.form-error-summary strong {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #93203a;
  font-size: 10.5px;
  font-weight: 700;
}

.form-error-summary ul {
  display: grid;
  gap: 3px;
  margin: 7px 0 0;
  padding-left: 16px;
}

.form-hint {
  margin: 10px 0 0;
  color: #a79dbb;
  font-size: 9.5px;
  line-height: 1.55;
}

/* ============ Discharge action ============ */
.discharge-action {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f6f1fc;
}

.discharge-action p {
  margin: 0;
  color: #a79dbb;
  font-size: 9.5px;
  line-height: 1.55;
}

.discharge-action .button {
  justify-self: start;
}

.discharge-action--done {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  color: #0b7f5e;
  font-size: 10px;
  line-height: 1.5;
  background: #eafaf3;
  border: 1px solid #cdf1e2;
  border-radius: 13px;
}

.patient-row[data-archived="1"] {
  opacity: 0.92;
}

/* ============ Auth ============ */
.auth-screen {
  background:
    radial-gradient(780px 560px at 12% 0%, #ecd9ff 0%, rgba(236, 217, 255, 0) 60%),
    radial-gradient(680px 520px at 94% 8%, #ffdcec 0%, rgba(255, 220, 236, 0) 58%),
    linear-gradient(158deg, #f3e9ff 0%, #fbf4ff 48%, #fdf0f8 100%);
}

.auth-screen::before {
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.34) 0,
    rgba(255, 255, 255, 0.34) 1px,
    rgba(255, 255, 255, 0) 1px,
    rgba(255, 255, 255, 0) 150px
  );
}

.auth-shell {
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 32px;
  box-shadow: 0 70px 120px -60px rgba(58, 32, 130, 0.55);
}

.auth-brand {
  padding: 42px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(155deg, #8a68ff 0%, #6a3ff2 55%, #5a2ee0 100%);
}

.auth-brand::before,
.auth-brand::after {
  background: rgba(255, 255, 255, 0.07);
}

.auth-brand__mark {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 13px;
}

.auth-brand__logo {
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.auth-brand__copy .eyebrow {
  color: rgba(255, 255, 255, 0.62);
}

.auth-brand__copy h1 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: -1.4px;
  line-height: 1.1;
}

.auth-brand__copy p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.6;
}

.auth-features li {
  color: rgba(255, 255, 255, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
}

.auth-features span {
  color: rgba(255, 255, 255, 0.45);
}

.auth-demo-note {
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
}

.auth-panel {
  padding: 42px;
  background: #fff;
}

.auth-card {
  width: 100%;
}

.auth-card .eyebrow {
  color: #9a90ae;
}

.auth-card h2 {
  color: #171122;
  font-family: var(--font-display);
  font-size: 27px;
  letter-spacing: -0.9px;
}

.auth-intro {
  color: #a79dbb;
  font-size: 11.5px;
}

.auth-field > span {
  color: #6b6280;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.auth-field input {
  height: 46px;
  color: #221a33;
  font-size: 12.5px;
  background: #fbf9ff;
  border: 1px solid #f1eaf9;
  border-radius: 13px;
}

.auth-field input:focus {
  background: #fff;
  border-color: #d3bdfb;
  box-shadow: 0 0 0 4px rgba(111, 75, 246, 0.09);
}

.auth-submit {
  height: 48px;
  font-size: 12px;
  border-radius: 14px;
  background: #171122;
}

.auth-demo {
  padding-top: 20px;
  border-top: 1px solid #f6f0fc;
}

.auth-demo__head span {
  color: #9a90ae;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.auth-demo__head small {
  color: #b6abc9;
  font-size: 8.5px;
}

.auth-demo__grid button {
  padding: 10px 12px;
  background: #fbf9ff;
  border: 1px solid #f2ecfa;
  border-radius: 13px;
}

.auth-demo__grid button:hover {
  background: #f5eeff;
  border-color: #e3d5fb;
}

.auth-demo__grid strong {
  color: #2b2340;
  font-size: 10px;
}

.auth-demo__grid span {
  color: #b3a9c6;
  font-size: 8.5px;
}

.auth-footer {
  color: #b6abc9;
  font-size: 8.5px;
}

.auth-error {
  color: #c41f47;
  font-size: 9.5px;
  background: #fff1f5;
  border: 1px solid #ffdde7;
  border-radius: 10px;
}

/* ============ Boot ============ */
.boot-screen {
  background: #f6f1ff;
}

.boot-screen__mark {
  color: #fff;
  background: linear-gradient(145deg, #8a68ff, #6134f0);
  border-radius: 16px;
}

.boot-screen strong {
  color: #171122;
}

.boot-screen p {
  color: #a79dbb;
}

.boot-screen__bar {
  background: #ede4fb;
}

.boot-screen__bar i {
  background: linear-gradient(90deg, #8a68ff, #6a3ff2);
}

/* ============ Triage board ============ */
.triage-board {
  gap: 14px;
}

.triage-column {
  background: #fdfbff;
  border: 1px solid #f4eefa;
  border-radius: 20px;
  box-shadow: 0 18px 36px -34px rgba(76, 44, 150, 0.5);
}

.triage-column--red {
  background: linear-gradient(180deg, #fff6f9, #fdfbff 30%);
  border-color: #ffe1ea;
}

.triage-column--yellow {
  background: linear-gradient(180deg, #fffbf3, #fdfbff 30%);
  border-color: #ffeed6;
}

.triage-column--green {
  background: linear-gradient(180deg, #f4fdf9, #fdfbff 30%);
  border-color: #d9f6eb;
}

.triage-column__head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f7f2fc;
}

.triage-column__title strong {
  color: #221a33;
  font-size: 12px;
  font-weight: 700;
}

.triage-column__count {
  color: #8b81a0;
  font-size: 9px;
  background: #fff;
  border: 1px solid #f2ecfa;
  border-radius: 999px;
}

.triage-card {
  background: #fff;
  border: 1px solid #f4eefa;
  border-radius: 15px;
  box-shadow: 0 10px 22px -22px rgba(76, 44, 150, 0.55);
}

.triage-card:hover {
  border-color: #e9dcfb;
  box-shadow: 0 16px 28px -22px rgba(76, 44, 150, 0.6);
}

/* ============ Patients directory ============ */
.patient-overview-bar {
  margin-bottom: 0;
  padding: 14px 0;
  background: #fff;
  border: 1px solid #f4eefa;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.overview-counter {
  gap: 5px;
  padding: 2px 18px;
  border-right: 1px solid #f6f1fc;
}

.overview-counter > span {
  color: #a79dbb;
  font-size: 9px;
  font-weight: 600;
}

.overview-counter strong {
  color: #171122;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.8px;
}

.overview-counter small {
  color: #b3a9c6;
  font-size: 8px;
}

.overview-counter--red > span {
  color: #d62a55;
}

.overview-counter--yellow > span {
  color: #b06a12;
}

.overview-counter--green > span {
  color: #0b7f5e;
}

.directory-toolbar {
  gap: 12px;
  padding: 18px 20px 12px;
}

.search-field {
  height: 44px;
  padding: 0 14px;
  gap: 9px;
  color: #a79dbb;
  background: #f8f4ff;
  border: 1px solid #f4eefb;
  border-radius: 13px;
}

.search-field:focus-within {
  background: #fff;
  border-color: #dccbfb;
  box-shadow: 0 0 0 4px rgba(111, 75, 246, 0.07);
}

.search-field input {
  font-size: 12px;
  color: #2b2340;
}

.search-field input::placeholder {
  color: #b3a9c6;
}

.search-field kbd {
  padding: 3px 6px;
  color: #a79dbb;
  font-size: 8.5px;
  font-weight: 650;
  background: #fff;
  border: 1px solid #f0eaf9;
  border-radius: 6px;
}

.directory-subtoolbar {
  gap: 10px;
  padding: 0 20px 14px;
}

.select-filter label {
  color: #9a90ae;
  font-size: 9.5px;
  font-weight: 600;
}

.select-filter select {
  height: 34px;
  padding: 0 28px 0 11px;
  color: #3f3752;
  font-size: 10px;
  font-weight: 600;
  background-color: #f8f4ff;
  border: 1px solid #f4eefb;
  border-radius: 10px;
}

.directory-result {
  color: #b3a9c6;
  font-size: 9px;
}

.patient-table--directory .patient-row {
  border-radius: 0;
  border-bottom: 1px solid #faf6fe;
}

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

.patient-table--directory .patient-row:hover {
  background: #fbf8ff;
  border-color: #f4edfd;
}

/* ============ Notices ============ */
.form-note,
.inline-notice {
  padding: 10px 12px;
  color: #6b5a95;
  font-size: 10px;
  line-height: 1.5;
  background: #faf6ff;
  border: 1px solid #f0e8fc;
  border-radius: 12px;
}

.form-note svg,
.inline-notice svg {
  color: #8a68ff;
}

/* ============ Side panel ============ */
.side-panel {
  background: #fff;
  border-left: 1px solid #f6f1fc;
  border-radius: 26px 0 0 26px;
  box-shadow: -40px 0 80px -50px rgba(40, 20, 90, 0.5);
}

.side-panel__header {
  padding: 22px 24px 14px;
  border-bottom: 1px solid #f6f1fc;
}

.side-panel__header h2 {
  color: #171122;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.side-panel__header p {
  color: #a79dbb;
  font-size: 10px;
}

.side-panel__close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #9a90ae;
  background: #f8f4ff;
  border: 1px solid #f2ecfa;
  border-radius: 12px;
}

.side-panel__close:hover {
  color: #3f3752;
  background: #f2ecff;
}

.side-panel__body {
  padding: 16px 18px 24px;
}

.panel-tabs {
  gap: 4px;
  padding: 4px;
  background: #f8f4ff;
  border: 1px solid #f4eefb;
  border-radius: 12px;
}

.panel-tab {
  height: 32px;
  padding: 0 12px;
  color: #9a90ae;
  font-size: 10px;
  font-weight: 650;
  background: transparent;
  border: 0;
  border-radius: 9px;
}

.panel-tab.is-active {
  color: #171122;
  background: #fff;
  box-shadow: 0 8px 16px -14px rgba(70, 40, 150, 0.6);
}

.panel-section-head {
  color: #8b81a0;
  font-size: 9px;
  font-weight: 650;
}

.panel-muted {
  color: #b3a9c6;
  font-size: 8.5px;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
}

.notification-item:hover {
  background: #fbf8ff;
  border-color: #f6f0fd;
}

.notification-item.is-unread {
  background: #fbf7ff;
  border-color: #f3ecfd;
}

.notification-item__icon {
  display: grid;
  flex: none;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #6f4bf6;
  background: #f2ecff;
  border-radius: 11px;
}

.notification-item__title {
  color: #221a33;
  font-size: 11px;
  font-weight: 650;
}

.notification-item__message {
  color: #a79dbb;
  font-size: 9.5px;
  line-height: 1.45;
}

.notification-item__meta {
  color: #b6abc9;
  font-size: 8.5px;
}

.unread-dot {
  background: #8a68ff;
}

/* ============ Auth ============ */
.auth-brand::before {
  top: -130px;
  right: -80px;
  width: 260px;
  height: 260px;
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow:
    0 0 0 34px rgba(255, 255, 255, 0.03),
    0 0 0 68px rgba(255, 255, 255, 0.02);
}

.auth-brand::after {
  right: -20%;
  bottom: -32%;
  width: 80%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 65%);
}

/* ============ Responsive ============ */
@media (max-width: 1320px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  }

  .dash-stats {
    gap: 12px;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    padding: 0;
  }

  .sidebar {
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
    box-shadow: 22px 0 60px rgba(40, 20, 80, 0.18);
  }

  .app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .topbar {
    border-radius: 0;
  }

  .view {
    padding: 22px 22px 30px;
    border-radius: 0;
  }

  .dash-grid,
  .dash-grid--bottom {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 900px) {
  .app-main {
    margin-left: 0;
  }

  .sidebar {
    width: 280px;
    border-radius: 0 26px 26px 0;
  }

  .sidebar__close {
    color: #8b81a0;
    background: #f8f4ff;
    border-color: #f2ecfa;
    border-radius: 10px;
  }

  .sidebar-scrim {
    background: rgba(28, 18, 48, 0.38);
    backdrop-filter: blur(3px);
  }

  .topbar {
    height: 68px;
    padding: 0 18px;
  }

  .view {
    padding: 18px 16px 28px;
  }

  .dash-hero {
    flex-direction: column;
    gap: 14px;
  }

  .dash-hero h1 {
    font-size: 25px;
    letter-spacing: -0.9px;
  }

  .dash-hero__side {
    width: 100%;
    flex-wrap: wrap;
  }

  .hero-user {
    margin-left: auto;
  }

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

  .stat-card {
    min-height: 136px;
  }

  .dash-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-tabs {
    display: none;
  }

  .chart-body {
    padding: 0 2px;
  }

  .dashboard-page .patient-table__head {
    display: none;
  }

  .dashboard-page .patient-row {
    grid-template-columns: minmax(150px, 1.6fr) 92px 92px 20px;
    gap: 8px;
  }

  .dashboard-page .patient-cell--status,
  .dashboard-page .patient-cell--team {
    display: none;
  }

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

  .shift-pill {
    width: 100%;
  }

  .auth-shell {
    border-radius: 0;
  }
}

@media (max-width: 620px) {
  .dash-hero h1 {
    font-size: 22px;
  }

  .dash-hero__side {
    display: none;
  }

  .dash-hero__eyebrow {
    font-size: 9.5px;
  }

  .dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    min-height: 0;
    padding: 12px 13px;
    border-radius: 16px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .stat-delta {
    padding: 3px 6px;
    font-size: 8px;
  }

  .stat-card__label {
    margin-top: 10px;
    font-size: 9.5px;
  }

  .stat-card__value {
    font-size: 25px;
  }

  .stat-card__foot {
    display: none;
  }

  .flow-axis {
    font-size: 17px;
  }

  .flow-tooltip,
  .flow-highlight {
    display: none;
  }

  .chart-summary strong {
    font-size: 22px;
  }

  .chart-summary em {
    display: none;
  }

  .chart-legend {
    gap: 10px;
  }

  .card-heading {
    flex-wrap: wrap;
  }

  .card-heading .text-button {
    white-space: nowrap;
  }

  .hero-shift {
    display: none;
  }

  .hero-user__copy {
    display: none;
  }

  .hero-user {
    padding: 5px;
  }

  .hero-user > svg {
    display: none;
  }

  .patient-table--directory .patient-row {
    margin: 6px 8px;
    padding: 12px;
    background: #fdfbff;
    border: 1px solid #f5f0fc;
    border-radius: 16px;
  }

  .patient-table--directory .patient-row:hover {
    background: #fbf7ff;
  }

  .patient-table--directory .patient-cell--team,
  .patient-table--directory .patient-cell--room {
    border-top-color: #f5effc;
  }

  .critical-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .critical-banner__meta {
    width: 100%;
    justify-content: space-between;
  }

  .chart-legend small {
    display: none;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-search {
    width: 100%;
  }

  .filter-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .dashboard-page .patient-row {
    grid-template-columns: minmax(140px, 1.5fr) 84px 18px;
    padding: 8px 10px;
  }

  .dashboard-page .patient-cell--time {
    display: none;
  }

  .patient-cell__copy span {
    font-size: 8.5px;
  }

  .team-list,
  .activity-list {
    padding-left: 8px;
    padding-right: 8px;
  }

  .capacity-overview {
    padding: 4px 16px 14px;
  }

  .zone-list {
    padding: 0 16px 16px;
  }

  .card-heading {
    padding: 16px 16px 12px;
  }

  .chart-card .card-heading {
    padding: 16px 16px 4px;
  }

  .chart-summary {
    padding: 6px 16px 0;
  }

  .chart-legend {
    margin: 4px 16px 0;
  }

  .card-footer-note {
    padding: 10px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-label i {
    animation: none;
  }
}
/* =========================================================
   Readability pass and common-case quick picker
   ========================================================= */
body {
  font-size: 16px;
}

.nav-item {
  font-size: 14.5px;
}

.nav-group__label {
  font-size: 10.5px;
}

.sidebar-user__copy strong {
  font-size: 13px;
}

.sidebar-user__copy small,
.sidebar-status strong,
.sidebar-status small {
  font-size: 10.5px;
}

.button {
  font-size: 14px !important;
}

.button--small {
  font-size: 12.5px !important;
}

.button--large {
  font-size: 15px !important;
}

.button--topbar {
  font-size: 13px !important;
}

.topbar-clock strong {
  font-size: 15px;
}

.topbar-clock span {
  font-size: 10.5px;
}

.global-search input {
  font-size: 13.5px;
}

.page-heading p {
  font-size: 14px;
}

.card-heading h2 {
  font-size: 17px;
}

.card-heading p {
  font-size: 11.5px;
}

.stat-card__label {
  font-size: 12px;
}

.stat-card__foot {
  font-size: 11px;
}

.patient-cell__copy strong {
  font-size: 14px;
}

.patient-cell__copy span {
  font-size: 11.5px;
}

.field__label {
  font-size: 12px;
}

.field__label small {
  font-size: 10px;
}

.field input,
.field select,
.field textarea {
  font-size: 14px;
}

.field__hint,
.field__error {
  font-size: 10.5px;
}

.form-section__head h3 {
  font-size: 14px;
}

.form-section__head p {
  font-size: 11.5px;
}

.form-section__number {
  font-size: 10px;
}

.form-note {
  font-size: 11.5px;
}

.priority-option__copy strong {
  font-size: 12px;
}

.priority-option__copy span {
  font-size: 10.5px;
}

.modal-lead {
  font-size: 13.5px;
}

small {
  font-size: 10.5px;
}

p {
  font-size: 12.5px;
}

b,
em {
  font-size: 10.5px;
}

label {
  font-size: 12px;
}

.status-badge,
.triage-badge,
.filter-chip,
.chart-tab,
.mini-action,
.text-button,
.bed-card__label,
.triage-card__symptoms,
.staff-row__shift,
.staff-row__identity span,
.staff-row__identity strong,
.staff-row__patients strong,
.team-profile__role,
.team-profile__chip,
.role-note,
.cell-sub,
.directory-result,
.triage-result,
.triage-summary,
.pending-ribbon,
.team-unassigned,
.count-badge,
.stat-delta,
.stat-link,
.stat-alert,
.critical-banner__eyebrow,
.critical-banner__link,
.critical-attention,
.capacity-critical,
.team-row__pct,
.card-link,
.live-label,
.compact-empty,
.bed-zone__head h3,
.zone-row strong,
.load-label strong,
.resource-stat strong,
.overview-counter strong {
  font-size: 11.5px;
}

.triage-card__id,
.triage-card__wait,
.triage-card__person span,
.triage-card__team,
.bed-card__status,
.bed-card__patient,
.bed-zone__head span,
.vital-chip,
.team-avatar,
.avatar,
.avatar--sm,
.flow-axis,
.notification-count,
.demo-tag,
.mini-flag,
.sidebar-footnote,
kbd,
.bed-card__foot,
.critical-equipment,
.triage-card__tags .status-badge {
  font-size: 10.5px;
}

.overview-counter > span,
.overview-counter > small,
.resource-stat > div > span,
.resource-stat > div > small,
.staff-row__patients small,
.staff-row__load .load-label small,
.staff-table__head,
.unassigned-item,
.staff-row {
  font-size: 11.5px;
}

.unassigned-item strong {
  font-size: 12.5px;
}

.unassigned-item p {
  font-size: 11.5px;
}

.patient-cell--time,
.patient-cell--room,
.patient-cell--team .team-names,
.patient-table__head,
.zone-row,
.chart-summary,
.card-footer-note,
.triage-column__meta,
.capacity-copy p,
.hero-shift,
.hero-user__copy,
.page-eyebrow,
.dash-hero__eyebrow {
  font-size: 11.5px;
}

.patient-cell--room > span,
.patient-cell--team .team-names small,
.team-names small,
.activity-row__meta,
.activity-row__copy span,
.team-row__copy span,
.chart-legend,
.bed-legend,
.critical-bed-highlight div > span,
.triage-footer {
  font-size: 10.5px;
}

.patient-cell--room strong,
.team-names strong,
.team-row__copy strong,
.activity-row__copy strong,
.critical-bed-highlight strong,
.hero-shift strong,
.hero-user__copy strong {
  font-size: 12.5px;
}

.patient-cell--person .avatar,
.team-row .avatar {
  font-size: 11px;
}

.filter-chips--small .filter-chip,
.incoming-card .card-link,
.search-field kbd,
.capacity-ring,
.flow-tooltip text {
  font-size: 11px;
}

.filter-chip span {
  font-size: 10.5px;
}

.resource-stat strong small {
  font-size: 11px;
}

.unassigned-item__top > span:last-child,
.unassigned-item__top span,
.unassigned-item__suggestion span,
.unassigned-item__suggestion small,
.activity-row__meta small,
.activity-row__meta span,
.capacity-ring span,
.team-profile__stats span,
.chart-summary em,
.chart-summary span,
.chart-legend small,
.chart-legend span,
.hero-shift small,
.hero-user__copy small,
.directory-subtoolbar .select-filter label,
.triage-column__title p {
  font-size: 11px;
}

.patient-cell--time > span,
.patient-cell--time > strong,
.zone-row > span,
.zone-row strong {
  font-size: 11.5px;
}

.case-picker {
  margin: 4px 0 12px;
  background: linear-gradient(135deg, #fbf8ff 0%, #f7f2ff 100%);
  border: 1px solid #eee4fb;
  border-radius: 14px;
}

.case-picker summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  cursor: pointer;
  list-style: none;
}

.case-picker summary::-webkit-details-marker {
  display: none;
}

.case-picker summary:focus-visible {
  border-radius: 14px;
  outline: 2px solid #b99cff;
  outline-offset: -2px;
}

.case-picker__icon {
  display: grid;
  flex: none;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #7a52e8;
  background: #efe6ff;
  border-radius: 10px;
}

.case-picker__copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.case-picker__copy strong {
  color: #34284c;
  font-size: 15px;
}

.case-picker__copy small {
  color: #8b7ba8;
  font-size: 12.5px;
  line-height: 1.45;
}

.case-picker__count {
  flex: none;
  padding: 4px 9px;
  color: #6336d8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: #efe6ff;
  border: 1px solid #e2d3ff;
  border-radius: 999px;
}

.case-picker__count[hidden] {
  display: none;
}

.case-picker__chevron {
  flex: none;
  margin-left: auto;
  color: #9b8ab8;
  transition: transform var(--transition);
}

.case-picker[open] .case-picker__chevron {
  transform: rotate(180deg);
}

.case-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 8px;
  padding: 0 14px 12px;
}

.case-chip {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 9px;
  padding: 9px 11px;
  color: #4d3f63;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  background: #fff;
  border: 1px solid #eee4fb;
  border-radius: 11px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.case-chip:hover {
  background: #fdfaff;
  border-color: #cdb6f8;
}

.case-chip:focus-visible {
  outline: 2px solid #8a68ff;
  outline-offset: 1px;
}

.case-chip.is-selected {
  background: #faf6ff;
  border-color: #8a68ff;
  box-shadow: 0 0 0 2px rgba(138, 104, 255, 0.1);
}

.case-chip > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.case-chip__icon {
  flex: none;
  color: #7a52e8;
}

.case-chip__check {
  display: none;
  flex: none;
  color: #6d3dde;
}

.case-chip.is-selected .case-chip__check {
  display: inline-flex;
}

.case-chip__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.case-picker__foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 14px 14px;
}

.case-picker__hint {
  color: #8b7ba8;
  font-size: 12px;
}

.case-picker__actions {
  display: flex;
  gap: 7px;
  margin-left: auto;
}

.case-chip__dot--red {
  background: #e9305c;
}

.case-chip__dot--yellow {
  background: #f0a512;
}

.case-chip__dot--green {
  background: #12b76a;
}

/* Layout adjustments for larger type */
.sidebar-user__copy strong {
  font-size: 12px;
}

.sidebar-user__copy small {
  font-size: 9.5px;
}

.facility-context__copy small {
  font-size: 9.5px;
}

.demo-tag {
  font-size: 9px;
}

.sidebar-footnote {
  font-size: 9.5px;
  line-height: 1.35;
}

.staff-table__head,
.staff-row {
  grid-template-columns: 34px minmax(150px, 1.55fr) 94px 78px minmax(140px, 1fr) 20px;
  column-gap: 8px;
}

@media (max-width: 560px) {
  .topbar .button--topbar {
    font-size: 0 !important;
  }
}

@media (max-width: 760px) {
  .patient-cell__copy strong {
    font-size: 13px;
  }

  .patient-cell__copy span {
    font-size: 10.5px;
  }
}

/* Login screen readability */
.auth-brand__copy .eyebrow {
  font-size: 11px;
}

.auth-brand__copy p {
  font-size: 14px;
}

.auth-features li {
  font-size: 13px;
}

.auth-demo-note,
.auth-footer {
  font-size: 10.5px;
}

.auth-card .eyebrow {
  font-size: 11px;
}

.auth-intro {
  font-size: 13.5px;
}

.auth-field > span {
  font-size: 12px;
}

.auth-field input {
  font-size: 14px;
}

.auth-submit {
  font-size: 14px;
}

.auth-demo__head span {
  font-size: 11px;
}

.auth-demo__head small {
  font-size: 10.5px;
}

.auth-demo__grid strong {
  font-size: 13px;
}

.auth-demo__grid span {
  font-size: 10.5px;
}

.auth-error {
  font-size: 11px;
}

/* Ambulance workspace readability */
.summary-tile > span {
  font-size: 11.5px;
}

.summary-tile strong {
  font-size: 23px;
}

.summary-tile strong small,
.summary-tile > small {
  font-size: 10.5px;
}

.protocol-steps strong {
  font-size: 13px;
}

.protocol-steps p {
  font-size: 11.5px;
  line-height: 1.45;
}

.protocol-note {
  font-size: 11px;
  line-height: 1.5;
}

.transfer-waiting,
.arrived-strip > span,
.arrived-chip {
  font-size: 10.5px;
}

@media (max-width: 560px) {
  .case-picker__copy small {
    display: none;
  }

  .case-picker summary {
    gap: 9px;
    padding: 12px;
  }
}

/* Patient information card readability */
.patient-info-card .card-muted {
  font-size: 11.5px;
}

.patient-info-card .clinical-summary {
  padding: 0 20px 14px;
}

.patient-info-card .clinical-summary > .eyebrow {
  font-size: 12px;
}

.patient-info-card .clinical-summary > p {
  margin-top: 5px;
  font-size: 13.5px;
  line-height: 1.55;
}

.patient-info-card .clinical-note {
  padding: 10px 11px;
}

.patient-info-card .clinical-note span {
  font-size: 11px;
}

.patient-info-card .clinical-note p {
  font-size: 12.5px;
}

.patient-info-card .allergy-row {
  margin-top: 11px;
  padding-top: 10px;
}

.patient-info-card .allergy-row span {
  font-size: 12px;
}

.patient-info-card .allergy-row strong {
  font-size: 12.5px;
}

.patient-info-card .info-list {
  padding: 0 20px 14px;
}

.patient-info-card .info-list > div {
  gap: 12px;
  padding: 9px 0;
}

.patient-info-card .info-list dt {
  gap: 6px;
  font-size: 12px;
}

.patient-info-card .info-list dt svg {
  width: 17px;
  height: 17px;
}

.patient-info-card .info-list dd {
  font-size: 13px;
}

.patient-info-card .info-list dd small {
  margin-top: 2px;
  font-size: 10.5px;
}

/* Triage, team and bed readability */
.confirmation {
  font-size: 11.5px;
}

.triage-card .current-triage {
  gap: 10px;
  padding: 12px;
}

.triage-card .current-triage > div strong {
  font-size: 13.5px;
}

.triage-card .current-triage > div span {
  font-size: 11.5px;
  line-height: 1.4;
}

.triage-card .triage-badge {
  height: 26px;
  font-size: 12px;
}

.triage-helper {
  font-size: 11px;
  line-height: 1.45;
}

.triage-history__item {
  gap: 9px;
  padding: 9px 0;
}

.triage-history__head strong {
  font-size: 12px;
}

.triage-history__head span {
  font-size: 10.5px;
}

.triage-history__item p {
  font-size: 11.5px;
  line-height: 1.45;
}

.triage-history__item small {
  margin-top: 3px;
  font-size: 10.5px;
}

.team-member {
  gap: 10px;
  padding: 10px 0;
}

.team-member .avatar {
  width: 36px;
  height: 36px;
  font-size: 12.5px;
}

.team-member strong {
  font-size: 13px;
}

.team-member small {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.35;
}

.team-empty {
  font-size: 12px;
}

.team-card .text-button {
  font-size: 12px;
}

.bed-zone__head h3 {
  font-size: 13px;
}

.bed-zone__head span {
  font-size: 11.5px;
}

.bed-card {
  padding: 10px 11px;
  border-radius: 9px;
}

.bed-card__icon svg {
  width: 16px;
  height: 16px;
}

.bed-card__status {
  gap: 4px;
  font-size: 11px;
}

.bed-card__status i {
  width: 5px;
  height: 5px;
}

.bed-card__label {
  gap: 5px;
  margin-top: 6px;
  font-size: 13px;
}

.bed-card__patient {
  margin-top: 3px;
  font-size: 11.5px;
}

.bed-card__foot {
  margin-top: 7px;
  font-size: 10.5px;
}

.critical-equipment {
  font-size: 10.5px;
}

@media (max-width: 760px) {
  .bed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* Notes, full history and treatment readability */
.notes-timeline {
  padding: 0 22px 10px;
}

.note-item {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  padding: 12px 0;
}

.note-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.notes-timeline .note-item__head strong {
  font-size: 13px;
}

.note-item__head span {
  font-size: 10.5px;
}

.notes-timeline .note-item__copy p {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.55;
}

.note-item__copy small {
  margin-top: 4px;
  font-size: 10.5px;
}

.notes-empty {
  font-size: 12px;
}

.audit-chip {
  padding: 4px 8px;
  font-size: 10.5px;
}

.full-history-card .card-muted {
  font-size: 12px;
}

.history-timeline {
  max-height: 440px;
  padding: 0 22px 13px;
}

.history-event {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  padding: 11px 0;
}

.history-event__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.history-event__copy strong {
  font-size: 12.5px;
}

.history-event__copy time {
  font-size: 10.5px;
}

.history-event__copy p {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.5;
}

.history-event__copy small {
  margin-top: 3px;
  font-size: 10.5px;
}

.treatment-card .status-control {
  gap: 6px;
  padding: 0 20px 13px;
}

.status-control label {
  font-size: 11.5px;
}

.status-control select {
  height: 40px;
  padding: 0 30px 0 11px;
  font-size: 13px;
}

.treatment-card .discharge-block {
  margin: 0 20px;
  padding: 12px;
}

.discharge-block__head > span {
  font-size: 12px;
}

.discharge-block > strong {
  font-size: 13px;
}

.discharge-block > p {
  font-size: 11px;
  line-height: 1.5;
}

.discharge-block > small {
  font-size: 10.5px;
  line-height: 1.5;
}

.treatment-meta {
  gap: 6px;
  padding: 12px 20px 14px;
  font-size: 11px;
}

.discharge-action p {
  font-size: 11.5px;
}

.discharge-action--done {
  font-size: 11.5px;
}

/* Vitals history table readability */
.vitals-history {
  margin: 0 20px 16px;
}

.vitals-history__head {
  padding: 10px 12px;
}

.vitals-history__head h3 {
  font-size: 13.5px;
}

.vitals-history__head > span {
  font-size: 11.5px;
}

.vitals-history .data-table th {
  padding: 9px 12px;
  font-size: 10.5px;
}

.vitals-history .data-table td {
  padding: 9px 12px;
  font-size: 12.5px;
}

.vitals-history .data-table td strong {
  font-size: 12.5px;
}

.vitals-history .data-table td span {
  margin-top: 2px;
  font-size: 10.5px;
}

.treatment-card .discharge-action .button {
  justify-self: center;
}
