:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f6faf8;
  --surface: #ffffff;
  --surface-soft: #eef8f4;
  --ink: #17211f;
  --muted: #63716d;
  --line: #dce7e2;
  --teal: #0f766e;
  --teal-dark: #134e4a;
  --blue: #2563eb;
  --amber: #b45309;
  --red: #dc2626;
  --green: #15803d;
  --shadow: 0 18px 50px rgba(25, 40, 37, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 260px),
    var(--bg);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  background: rgba(246, 250, 248, 0.9);
  border-bottom: 1px solid rgba(220, 231, 226, 0.88);
  backdrop-filter: blur(18px);
}

.brand-block,
.header-actions,
.role-switch,
.access-chip,
.section-heading,
.card-topline,
.card-footer,
.detail-actions,
.form-actions-band,
.panel-title-row,
.notification-item,
.session-pill,
.security-strip,
.review-banner,
.admin-row {
  display: flex;
  align-items: center;
}

.brand-block {
  min-width: 0;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.05rem, 4vw, 1.55rem);
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.28rem, 4vw, 1.9rem);
  line-height: 1.1;
}

h3 {
  margin-bottom: 4px;
  font-size: 1rem;
  line-height: 1.15;
}

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

.header-actions {
  gap: 10px;
}

.role-switch {
  gap: 4px;
  padding: 4px;
  background: #e8f2ee;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.role-switch button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 750;
}

.role-switch button.active {
  color: var(--teal-dark);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(19, 78, 74, 0.1);
}

.access-chip {
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--teal-dark);
  background: #e8f2ee;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
}

.access-chip strong {
  padding: 4px 7px;
  color: white;
  background: var(--teal);
  border-radius: 999px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.icon-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--teal-dark);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  color: white;
  background: var(--red);
  border: 2px solid var(--bg);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.notification-wrap {
  position: relative;
}

.notification-panel {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 20;
  width: min(340px, calc(100vw - 24px));
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-title-row {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.text-button {
  padding: 0;
  color: var(--teal);
  background: transparent;
  border: 0;
  font-weight: 800;
}

.notification-item {
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.notification-item p {
  margin: 2px 0 4px;
  font-size: 0.9rem;
}

.flash-banner {
  padding: 12px 14px;
  margin: 14px 0 0;
  color: var(--teal-dark);
  background: #e8f7ef;
  border: 1px solid #bfe8d6;
  border-radius: 8px;
  font-weight: 800;
}

.flash-banner.error {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.flash-banner.success {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.notification-item small,
.audit-item small {
  color: var(--muted);
}

.read-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  margin-top: 6px;
  background: var(--blue);
  border-radius: 50%;
}

.read-dot.muted {
  background: var(--line);
}

.workspace {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 16px;
  padding-top: 18px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-box input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
}

.snapshot {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.metric {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  color: var(--muted);
  font-weight: 700;
}

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

.metric-danger svg,
.urgent {
  color: var(--red);
}

.metric-blue svg {
  color: var(--blue);
}

.metric-amber svg {
  color: var(--amber);
}

.metric-green svg {
  color: var(--green);
}

.security-strip {
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  color: #123d38;
  background: #e8f7ef;
  border: 1px solid #bfe8d6;
  border-radius: 8px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 18px;
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.login-shell.single-login {
  grid-template-columns: 1fr;
  place-items: center;
}

.login-hero,
.login-card,
.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-hero {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(15, 118, 110, 0.02)),
    var(--surface);
}

.login-copy h2 {
  max-width: 16ch;
  margin-bottom: 10px;
}

.login-copy p,
.login-note,
.demo-account p,
.panel-card p,
.strip-note {
  margin-bottom: 0;
}

.login-panel,
.stack-form,
.demo-account-list,
.overview-grid,
.admin-layout {
  display: grid;
  gap: 14px;
}

.login-card,
.panel-card {
  padding: 18px;
}

.compact-login {
  width: min(460px, 100%);
  padding: 28px;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-bottom: 18px;
  text-align: center;
}

.login-brand .brand-mark {
  width: 56px;
  height: 56px;
}

.login-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.login-feature-grid article {
  padding: 14px;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-feature-grid strong {
  display: block;
  margin: 10px 0 5px;
}

.login-error {
  padding: 10px 12px;
  margin: 10px 0 14px;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-weight: 800;
}

.demo-account {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.demo-account:first-child {
  border-top: 0;
  padding-top: 0;
}

.demo-account small {
  display: block;
  margin-top: 6px;
  color: var(--teal-dark);
  font-weight: 800;
}

.sidebar-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  box-shadow: 0 8px 28px rgba(25, 40, 37, 0.04);
}

.sidebar-link.active {
  border-color: var(--teal);
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.12);
}

.sidebar-link-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--teal-dark);
  background: #e8f2ee;
  border-radius: 8px;
}

.sidebar-link strong,
.sidebar-link small {
  display: block;
  min-width: 0;
}

.sidebar-link small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.sidebar-link em {
  min-width: 26px;
  padding: 4px 7px;
  color: white;
  background: var(--teal);
  border-radius: 999px;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
  text-align: center;
}

.security-strip p {
  margin: 2px 0 0;
  font-size: 0.88rem;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.98fr);
  gap: 16px;
  min-width: 0;
}

.dashboard-column,
.ward-workspace,
.admin-console {
  min-width: 0;
}

.section-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-clock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 11px 13px;
  margin-bottom: 14px;
  color: var(--teal-dark);
  background: #e8f7ef;
  border: 1px solid #bfe8d6;
  border-radius: 8px;
}

.dashboard-clock span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #28635c;
  font-weight: 850;
}

.dashboard-clock strong {
  color: var(--ink);
  text-align: right;
}

.compact-metrics,
.admin-metrics {
  margin-bottom: 14px;
}

.soft-button,
.ghost-button,
.primary-button,
.success-button,
.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 8px;
  font-weight: 800;
  line-height: 1;
}

.soft-button {
  color: var(--teal-dark);
  background: #e8f2ee;
  border: 1px solid var(--line);
}

.ghost-button {
  color: var(--teal-dark);
  background: var(--surface);
  border: 1px solid var(--line);
}

.primary-button,
.submit-button {
  color: white;
  background: var(--teal);
  border: 1px solid var(--teal);
}

.success-button {
  color: white;
  background: var(--green);
  border: 1px solid var(--green);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

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

.tab {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 9px 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  text-align: left;
}

.tab span {
  min-width: 0;
}

.tab strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  color: var(--teal-dark);
  background: #e8f2ee;
  border-radius: 999px;
  font-size: 0.8rem;
}

.tab.active {
  color: white;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.tab.active strong {
  color: var(--teal-dark);
  background: white;
}

.referral-list {
  display: grid;
  gap: 10px;
}

.history-list {
  display: grid;
  gap: 14px;
}

.date-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.date-filter-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.date-group {
  display: grid;
  gap: 10px;
}

.date-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
}

.date-heading strong {
  color: var(--teal-dark);
}

.date-heading span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.referral-card {
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(25, 40, 37, 0.05);
}

.referral-card.urgent {
  border-left-color: var(--red);
}

.referral-card.non_urgent {
  border-left-color: var(--teal);
}

.referral-card.selected {
  border-color: var(--teal);
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.12);
}

.card-topline {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.patient-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.patient-row p,
.clinical-line,
.ward-row p {
  margin-bottom: 0;
}

.clinical-line {
  margin-top: 10px;
  color: var(--ink);
}

.ward-pill,
.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  color: var(--teal-dark);
  background: #e8f2ee;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.card-footer {
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.card-footer span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.quick-actions.single-action {
  grid-template-columns: 1fr;
}

.urgency-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.urgency-badge {
  color: var(--teal-dark);
  background: #e8f2ee;
}

.urgency-badge.urgent {
  color: #991b1b;
  background: #fee2e2;
}

.status-badge {
  color: #1f3a35;
  background: #edf2f0;
}

.status-new {
  color: #991b1b;
  background: #fee2e2;
}

.status-seen,
.status-in_progress {
  color: #1d4ed8;
  background: #dbeafe;
}

.status-completed_ready {
  color: #166534;
  background: #dcfce7;
}

.status-needs_review {
  color: #92400e;
  background: #fef3c7;
}

.detail-panel {
  align-self: start;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
}

.detail-header p {
  margin-bottom: 0;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.clinical-panel {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.info-line span,
.field span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.info-line p {
  margin-bottom: 0;
  color: var(--ink);
}

.action-panel {
  display: grid;
  gap: 9px;
  margin: 13px 0;
}

.action-hint {
  margin: -3px 0 2px;
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 800;
}

.review-scheduler {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.review-scheduler label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  color: var(--muted);
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.review-scheduler input {
  width: 62px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
}

.review-banner,
.plan-note {
  gap: 9px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
}

.plan-note {
  display: block;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.plan-note p {
  margin: 4px 0 0;
  color: var(--ink);
}

.audit-block {
  padding-top: 4px;
}

.audit-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.audit-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  background: var(--teal);
  border-radius: 50%;
}

.audit-item p {
  margin: 1px 0 3px;
  font-size: 0.88rem;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed #b9c9c3;
  border-radius: 8px;
  text-align: center;
}

.empty-state p {
  margin: 0;
}

.referral-form {
  display: grid;
  gap: 12px;
}

.form-band {
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(25, 40, 37, 0.04);
}

.form-band h3 {
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(90px, 0.5fr) minmax(0, 1fr);
  gap: 10px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfefd;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-box:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.form-band .field + .field {
  margin-top: 10px;
}

.form-grid .field + .field {
  margin-top: 0;
}

.form-actions-band {
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-actions-band.single-row {
  align-items: center;
  justify-content: space-between;
}

.compact-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auto-field {
  padding: 10px 12px;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auto-field span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.auto-field strong {
  color: var(--ink);
}

.urgency-toggle,
.file-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 13px;
  color: var(--teal-dark);
  background: #e8f2ee;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
}

.urgency-toggle.urgent-on {
  color: white;
  background: var(--red);
  border-color: var(--red);
}

.file-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.submit-button {
  min-height: 52px;
  font-size: 1rem;
}

.strip-note {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

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

.ward-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-row {
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-row p {
  margin: 2px 0 0;
}

.admin-row > span {
  padding: 5px 9px;
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 850;
}

.avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--teal-dark);
  background: #e8f2ee;
  border-radius: 8px;
}

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

.plain-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink);
}

.plain-list li + li {
  margin-top: 8px;
}

.firebase-warning {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-ghost {
  color: #991b1b;
  border-color: #fecaca;
  background: #fff7f7;
}

.inline-field {
  margin: 0;
}

.empty-detail {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 420px;
}

.compact-empty {
  min-height: 220px;
}

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

  .sidebar {
    display: grid;
    grid-template-columns: 1fr;
  }

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

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

  .detail-panel {
    order: -1;
  }
}

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

  .login-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .role-switch {
    flex: 1;
  }

  .role-switch button {
    flex: 1;
    justify-content: center;
    padding-inline: 7px;
  }

  .role-switch span {
    display: none;
  }

  .access-chip span {
    display: none;
  }

  .snapshot,
  .tabs,
  .form-grid,
  .ward-list,
  .login-feature-grid,
  .overview-grid,
  .admin-layout,
  .compact-band {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading .soft-button,
  .section-heading .primary-button {
    flex: 0 0 auto;
  }

  .detail-actions,
  .quick-actions,
  .review-scheduler,
  .form-actions-band,
  .date-filter-bar {
    grid-template-columns: 1fr;
  }

  .form-actions-band {
    display: grid;
  }

  .patient-row,
  .detail-header,
  .admin-row,
  .demo-account {
    grid-template-columns: 1fr;
  }

  .ward-pill {
    justify-self: start;
  }

  .admin-row {
    display: grid;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .profile-chip {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .date-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
