:root {
  color-scheme: light;
  --ink-900: #0f1c2e;
  --ink-700: #2a3b52;
  --ink-600: #3f526b;
  --ink-500: #51657f;
  --mist-50: #f6f8fb;
  --mist-100: #edf2f7;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --line-soft: rgba(15, 23, 42, 0.1);
  --teal-600: #0f766e;
  --teal-500: #14b8a6;
  --amber-400: #f59e0b;
  --blue-700: #1d4ed8;
  --shadow-soft: 0 16px 36px rgba(15, 23, 42, 0.1);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-xl: 8px;
}

html {
  font-size: 16px;
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 34rem);
  color: var(--ink-900);
}

h1, h2, h3, h4 {
  font-family: "Newsreader", "Georgia", serif;
  color: var(--ink-900);
  letter-spacing: 0;
}

.topbar {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mobile-menu-toggle,
.sidebar-close,
.sidebar-backdrop,
.sidebar-mobile-header {
  display: none;
}

.brand-mark {
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink-900);
  line-height: 1;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
}

.topbar-actions .navbar-nav {
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
}

.topbar-link {
  color: var(--ink-700);
  font-weight: 700;
  padding-inline: 0.5rem;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  max-width: min(34vw, 280px);
  gap: 0.55rem;
  color: var(--ink-900);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  background: var(--surface);
}

.topbar-context {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  padding-right: 0.35rem;
}

.topbar-context-label {
  color: var(--ink-900);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.1;
}

.topbar-context-meta {
  color: var(--ink-500);
  font-size: 0.78rem;
  line-height: 1.1;
}

.topbar-icon-link {
  position: relative;
  display: inline-flex;
  width: 2.45rem;
  height: 2.45rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-700);
  text-decoration: none;
}

.topbar-icon-link:hover,
.topbar-icon-link:focus-visible {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(20, 184, 166, 0.08);
  color: var(--teal-600);
}

.topbar-icon {
  width: 1.18rem;
  height: 1.18rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  display: inline-flex;
  min-width: 1.25rem;
  height: 1.25rem;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #b91c1c;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.account-avatar {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal-600);
  font-weight: 800;
  flex: 0 0 auto;
}

.account-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 72px);
}

.app-shell-guest {
  grid-template-columns: 1fr;
}

.sidebar {
  background: var(--surface-muted);
  border-right: 1px solid var(--line-soft);
  padding: 1.4rem 1rem;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 1.25rem;
}

.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--ink-500);
  margin: 0 0 0.55rem 0.45rem;
  font-weight: 800;
}

.sidebar-link {
  display: block;
  min-height: 2.55rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md);
  color: var(--ink-700);
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}

.sidebar-link-with-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.notification-count,
.notification-status {
  display: inline-flex;
  min-width: 1.5rem;
  min-height: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #0f766e;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: #ffffff;
  color: var(--teal-600);
  border-color: rgba(15, 118, 110, 0.18);
}

.sidebar-link.active {
  box-shadow: inset 3px 0 0 var(--teal-600), 0 8px 18px rgba(15, 23, 42, 0.05);
  font-weight: 800;
}

.content-wrap {
  min-width: 0;
  padding: 2rem clamp(1.25rem, 3vw, 2.5rem);
}

.notification-list {
  display: grid;
  gap: 1rem;
}

.notification-item,
.empty-state {
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.empty-state {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}

.empty-state p {
  max-width: 58ch;
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.15rem;
}

.empty-state-inline {
  border-style: dashed;
  box-shadow: none;
  background: #f8fafc;
}

.empty-state-inline h2 {
  font-size: 0.98rem;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.notification-unread {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 16px 32px rgba(15, 118, 110, 0.12);
}

.notification-item h2,
.empty-state h2 {
  margin: 0;
  font-size: 1.05rem;
}

.notification-item p {
  margin: 0;
  color: var(--ink-600);
  line-height: 1.6;
}

.notification-meta {
  color: var(--ink-500);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.message-inbox {
  display: grid;
  gap: 0.85rem;
}

.inbox-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.inbox-tab {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--ink-700);
  font-weight: 800;
  text-decoration: none;
}

.inbox-tab:hover,
.inbox-tab:focus-visible,
.inbox-tab.active {
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal-600);
}

.message-thread {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #ffffff;
}

.message-thread-unread {
  border-color: rgba(15, 118, 110, 0.4);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.1);
}

.message-thread-avatar {
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal-600);
  font-weight: 800;
}

.message-thread-content,
.message-thread-heading > div {
  min-width: 0;
}

.message-thread-heading,
.message-thread-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.message-thread h2 {
  margin: 0;
  font-size: 1.1rem;
}

.message-thread p {
  margin: 0.65rem 0;
  color: var(--ink-700);
  overflow-wrap: anywhere;
}

.message-thread-footer {
  align-items: center;
}

.message-thread-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0f766e, #0f9e90);
  border: none;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0e675f, #0b877b);
}

.btn-outline-secondary {
  border-color: rgba(15, 23, 42, 0.2);
  color: var(--ink-700);
}

.btn-outline-secondary:hover {
  background: var(--mist-100);
  color: var(--ink-900);
}

.hero-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 2rem;
}

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--line-soft);
  height: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.1);
  color: var(--teal-600);
  font-weight: 600;
  font-size: 0.85rem;
}

.feature-grid {
  display: grid;
  gap: 1.5rem;
}

.portal-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.portal-header h1 {
  margin-bottom: 0;
}

.portal-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 44%);
  gap: 1rem;
  align-items: stretch;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.dashboard-hero-main {
  display: flex;
  min-height: 13rem;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1rem, 2.4vw, 2rem);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0f1c2e, #123f4a);
  color: #e2e8f0;
}

.dashboard-hero-main h2 {
  margin: 0.35rem 0 0.65rem;
  color: #ffffff;
  font-size: clamp(1.7rem, 2.8vw, 2.45rem);
  line-height: 1.05;
}

.dashboard-hero-main p {
  max-width: 62ch;
  margin: 0;
  color: #cbd5e1;
  line-height: 1.65;
}

.dashboard-kicker {
  color: #99f6e4;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-content: stretch;
}

.dashboard-hero-actions .care-action {
  min-height: 100%;
  justify-content: flex-end;
}

.metric-card {
  height: 100%;
  min-height: 8.25rem;
  padding: 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--ink-500);
}

.metric-card span {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 0.45rem 0 0.2rem;
  color: var(--ink-900);
  font-size: clamp(1.65rem, 2vw, 2.1rem);
  line-height: 1.1;
}

.metric-card small {
  font-size: 0.9rem;
}

.metric-card-compact {
  min-height: 7rem;
}

.readiness-panel {
  padding: 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #f8fafc;
}

.action-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

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

.action-row {
  display: flex;
  min-height: 5.75rem;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink-900);
  text-decoration: none;
}

.action-row:hover,
.action-row:focus-visible {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  color: var(--teal-600);
}

.action-row span {
  color: var(--ink-500);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.action-row strong {
  color: inherit;
  font-size: 1rem;
}

.action-row-primary {
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
}

.action-row-primary span,
.action-row-primary strong {
  color: #ffffff;
}

.alert-grid,
.attention-list,
.activity-list {
  display: grid;
  gap: 0.75rem;
}

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

.dashboard-alert,
.attention-item {
  display: grid;
  align-items: start;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.dashboard-alert {
  grid-template-columns: 5.5rem minmax(0, 1fr);
}

.attention-item {
  grid-template-columns: 7rem minmax(0, 1fr);
}

.dashboard-alert:hover,
.dashboard-alert:focus-visible,
.attention-item:hover,
.attention-item:focus-visible {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.04);
}

.dashboard-alert.critical {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.04);
}

.dashboard-alert.warning {
  border-color: rgba(245, 158, 11, 0.26);
  background: rgba(245, 158, 11, 0.05);
}

.alert-severity,
.attention-type {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  background: rgba(71, 85, 105, 0.12);
  color: #475569;
  font-size: 0.8rem;
  font-weight: 800;
}

.dashboard-alert.critical .alert-severity {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.dashboard-alert.warning .alert-severity,
.attention-type {
  background: rgba(245, 158, 11, 0.12);
  color: #a16207;
}

.activity-item {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}

.activity-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.readiness-card {
  padding: 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.readiness-card h4 {
  font-size: 1.05rem;
}

.readiness-progress {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.readiness-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0f766e;
}

.readiness-card-list {
  display: grid;
  gap: 0.55rem;
}

.readiness-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--ink-700);
  font-size: 0.9rem;
}

.readiness-dot {
  width: 0.65rem;
  height: 0.65rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f59e0b;
}

.readiness-dot.ready {
  background: #0f766e;
}

.readiness-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.readiness-badge.ready {
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.18);
}

.readiness-badge.attention {
  background: rgba(245, 158, 11, 0.12);
  color: #a16207;
  border-color: rgba(245, 158, 11, 0.18);
}

.form-workflow {
  display: grid;
  gap: 1rem;
  max-width: 980px;
}

.form-workflow-wide {
  max-width: 1180px;
}

.form-workflow > .row,
.form-workflow > .mt-4 {
  padding: 1.25rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.form-workflow > .mt-4 h4 {
  margin-bottom: 1rem;
  font-size: 1.12rem;
}

.form-panel {
  padding: 1.25rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.form-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-panel-header h2,
.form-panel-header h3,
.form-panel-header h4 {
  margin: 0;
  font-size: 1.12rem;
}

.form-panel-header p {
  margin: 0.25rem 0 0;
  color: var(--ink-500);
}

.form-step {
  display: inline-flex;
  min-width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal-600);
  font-weight: 900;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem 0 0;
}

.form-actions .alert {
  flex: 1 1 100%;
  margin-bottom: 0;
}

.form-note {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(29, 78, 216, 0.16);
  border-radius: var(--radius-md);
  background: rgba(29, 78, 216, 0.06);
  color: var(--ink-700);
}

.medication-line {
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #f8fafc;
}

.medication-line-title {
  display: inline-flex;
  margin-bottom: 0.85rem;
  color: var(--ink-700);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.list-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
}

.list-toolbar-wide {
  grid-template-columns: minmax(240px, 1.2fr) repeat(2, minmax(160px, 0.6fr)) auto;
}

.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.table-panel {
  padding: 1.25rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.table-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-panel-header h2,
.table-panel-header h3,
.table-panel-header h4 {
  margin: 0;
  font-size: 1.12rem;
}

.table-panel-header p {
  margin: 0.25rem 0 0;
  color: var(--ink-500);
}

.table-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.restock-input {
  width: 7rem;
}

.advice-item {
  position: relative;
  margin-bottom: 0.7rem;
  padding-left: 1.1rem;
  color: var(--ink-700);
  line-height: 1.55;
}

.advice-item::before {
  content: "";
  position: absolute;
  top: 0.62rem;
  left: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--teal-600);
}

.workflow-stack,
.timeline-list,
.consultation-grid {
  display: grid;
  gap: 1rem;
}

.workflow-row,
.timeline-item,
.consultation-card,
.care-action {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.workflow-row,
.timeline-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.timeline-item {
  justify-content: flex-start;
}

.care-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 0.75rem;
  min-width: min(100%, 560px);
}

.care-action {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem;
  color: var(--ink-900);
  text-decoration: none;
  min-height: 5.35rem;
}

.care-action:hover {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(20, 184, 166, 0.08);
}

.care-action span {
  color: var(--ink-500);
  font-size: 0.85rem;
}

.care-action strong {
  font-size: 0.95rem;
}

.consultation-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.consultation-card {
  padding: 1.25rem;
}

.hero-card,
.stat-card,
.feature-card,
.consultation-card,
.workflow-row,
.timeline-item,
.care-action,
.message-thread,
.notification-item,
.empty-state {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.feature-card:hover,
.consultation-card:hover,
.care-action:hover,
.message-thread:hover {
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.message-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.status-badge,
.activity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .35rem .75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .8rem;
  border: 1px solid transparent;
  white-space: nowrap;
}

.activity-badge,
.status-badge.not-required {
  background: rgba(71, 85, 105, 0.12);
  color: #475569;
  border-color: rgba(71, 85, 105, 0.18);
}

.status-badge.active,
.status-badge.verified,
.status-badge.approved,
.status-badge.completed,
.status-badge.fulfilled,
.status-badge.paid,
.status-badge.succeeded,
.status-badge.success {
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.18);
}

.status-badge.pending,
.status-badge.expiring,
.status-badge.scheduled,
.status-badge.checkedin,
.status-badge.processing,
.status-badge.awaitingpayment,
.status-badge.awaiting-payment {
  background: rgba(245, 158, 11, 0.12);
  color: #a16207;
  border-color: rgba(245, 158, 11, 0.18);
}

.status-badge.rejected,
.status-badge.expired,
.status-badge.missing,
.status-badge.suspended,
.status-badge.declined,
.status-badge.cancelled,
.status-badge.failed {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.18);
}

@media (min-width: 992px) {
  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.section-muted {
  background: var(--mist-50);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.hero {
  position: relative;
  padding: 3.25rem 0 2.5rem;
}

.hero-glow {
  display: none;
}

.hero > .row {
  position: relative;
  z-index: 1;
  align-items: center;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--ink-500);
  font-size: 0.9rem;
  align-items: center;
}

.hero-panel {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line-soft);
}

.hero-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.hero-panel-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.hero-tag {
  background: rgba(29, 78, 216, 0.1);
  color: var(--blue-700);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.hero-panel-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-panel-grid .stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0.4rem 0;
}

.hero-panel-footer {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  color: var(--ink-500);
  font-size: 0.85rem;
}

.section-block {
  margin: 3.5rem 0;
}

.feature-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--line-soft);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.video-panel {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 2rem;
  border: 1px solid var(--line-soft);
}

.video-panel ul {
  margin-top: 1rem;
  padding-left: 0;
}

.video-panel ul li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.video-panel-badge {
  display: inline-flex;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.2);
  color: var(--teal-600);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.cta-card {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-md);
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cta-card .btn-outline-secondary {
  border-color: rgba(226, 232, 240, 0.4);
  color: #e2e8f0;
}

.cta-card .btn-outline-secondary:hover {
  background: rgba(226, 232, 240, 0.1);
}

@media (max-width: 991px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-main {
    min-height: 11rem;
  }

  .dashboard-hero-actions {
    grid-template-columns: 1fr;
  }

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

  .list-toolbar,
  .list-toolbar-wide {
    grid-template-columns: 1fr;
  }

  .list-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .table-panel-header {
    flex-direction: column;
  }

  .alert-grid,
  .readiness-grid,
  .dashboard-alert,
  .attention-item {
    grid-template-columns: 1fr;
  }

  .hero-panel-grid {
    grid-template-columns: 1fr;
  }

  .portal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-header-actions {
    justify-content: flex-start;
  }

  .care-action-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

.table {
  background: #ffffff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  border: 1px solid var(--line-soft);
}

.table thead th {
  background: #f8fafc;
  color: var(--ink-700);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  border-bottom: 1px solid var(--line-soft);
}

.table tbody td {
  vertical-align: middle;
}

.site-footer {
  margin-top: 4rem;
  padding: 2.5rem 0 2rem;
  background: #0f172a;
  color: #e2e8f0;
}

@media (max-width: 991px) {
  .topbar {
    min-height: auto;
    padding: 0.35rem 0;
  }

  .topbar .container-fluid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-mark span {
    font-size: 0.95rem;
  }

  .topbar-actions .navbar-nav {
    gap: 0.35rem;
  }

  .topbar-icon-link {
    width: 2.35rem;
    height: 2.35rem;
  }

  .account-chip {
    max-width: 3rem;
    padding-right: 0.4rem;
  }

  .account-label {
    display: none;
  }

  .topbar-link {
    padding-inline: 0.35rem;
    font-size: 0.9rem;
  }

  .app-shell {
    display: block;
    min-height: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--radius-md);
    background: #ffffff;
  }

  .mobile-menu-toggle span {
    width: 1.15rem;
    height: 2px;
    border-radius: 2px;
    background: var(--ink-900);
  }

  .sidebar {
    position: fixed;
    z-index: 1050;
    top: 0;
    bottom: 0;
    left: -100vw;
    width: min(20rem, 86vw);
    height: 100vh;
    padding: 0 1rem 1.5rem;
    border-right: 1px solid rgba(15, 23, 42, 0.12);
    border-bottom: 0;
    overflow-y: auto;
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.18);
  }

  .sidebar.is-open {
    left: 0;
  }

  .sidebar-mobile-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 1;
    align-items: center;
    justify-content: space-between;
    min-height: 4.5rem;
    margin: 0 -1rem 1rem;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    font-weight: 800;
  }

  .sidebar-close {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--mist-100);
    color: var(--ink-900);
    font-size: 1.75rem;
    line-height: 1;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    z-index: 1040;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    pointer-events: none;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-section {
    margin-bottom: 1.5rem;
  }

  .sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.5rem;
    margin: 0;
    white-space: normal;
  }

  .sidebar-link.active {
    box-shadow: inset 3px 0 0 var(--teal-600);
  }

  .sidebar-link-with-count {
    justify-content: space-between;
  }

  .content-wrap {
    padding: 1.25rem;
    min-width: 0;
  }
}

@media (max-width: 575px) {
  .inbox-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .action-list {
    grid-template-columns: 1fr;
  }

  .message-composer {
    grid-template-columns: 1fr;
  }

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

  .message-thread {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.9rem;
  }

  .message-thread-avatar {
    width: 2.5rem;
    height: 2.5rem;
  }

  .message-thread-heading,
  .message-thread-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .message-thread-footer .d-flex {
    flex-wrap: wrap;
  }
}

.footer-brand {
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-note {
  margin: 0.5rem 0 0;
  max-width: 360px;
  color: #cbd5f5;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.footer-links a {
  color: #e2e8f0;
  text-decoration: none;
}

.footer-links a:hover {
  color: #7dd3fc;
}

.footer-legal {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.form-control:focus, .form-select:focus {
  border-color: rgba(20, 184, 166, 0.7);
  box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.2);
}

.validation-summary-valid {
  display: none;
}

.alert:empty {
  display: none;
}

.auth-shell {
  min-height: calc(100vh - 88px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.auth-page .auth-shell {
  min-height: 100vh;
}

.auth-card {
  width: min(480px, 100%);
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line-soft);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.auth-title {
  font-weight: 700;
  font-size: 1.4rem;
}

.auth-subtitle {
  color: var(--ink-500);
}

.auth-home {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mist-50);
  color: var(--ink-700);
  text-decoration: none;
}

.auth-home svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.auth-home:hover {
  background: rgba(20, 184, 166, 0.15);
  color: var(--teal-600);
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.chat-window {
  background: var(--mist-50);
  border-radius: var(--radius-md);
  padding: 1rem;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  background: #ffffff;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  max-width: 85%;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.06);
}

.chat-message-self {
  align-self: flex-end;
  background: rgba(20, 184, 166, 0.15);
}

.consultation-room {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.consultation-room-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.consultation-room-meta {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.consultation-room-status {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem;
  background: #ffffff;
  color: var(--ink-700);
  font-weight: 600;
}

.call-readiness-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink-700);
}

.call-readiness-bar > div {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.consultation-room-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
  gap: 1.5rem;
  align-items: start;
}

.media-stage {
  position: relative;
  min-height: 560px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: var(--shadow-soft);
}

.media-stage-header {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  color: #ffffff;
  pointer-events: none;
}

.media-stage-title {
  font-size: 1rem;
  font-weight: 900;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.media-stage-subtitle {
  color: #cbd5e1;
  font-size: 0.85rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.media-live-badge {
  display: inline-flex;
  min-height: 1.8rem;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
}

.remote-video-wrap,
.remote-video {
  width: 100%;
  height: 100%;
  min-height: 560px;
}

.remote-video,
.local-video {
  display: block;
  object-fit: cover;
  background: #0f172a;
}

.media-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #e2e8f0;
  text-align: center;
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(15, 28, 46, 0.94), rgba(18, 63, 74, 0.86)),
    #0f172a;
}

.media-placeholder-title {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 900;
}

.media-placeholder-copy {
  margin-top: 0.35rem;
  color: #cbd5e1;
}

.local-video-wrap {
  position: absolute;
  right: 1rem;
  bottom: 5.25rem;
  width: min(220px, 36%);
  aspect-ratio: 16 / 10;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #111827;
}

.local-video {
  width: 100%;
  height: 100%;
}

.local-video-label {
  position: absolute;
  left: 0.5rem;
  bottom: 0.4rem;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.call-controls {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
}

.live-chat-panel {
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.live-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.live-chat-header h4 {
  margin: 0;
}

.live-chat-window {
  max-height: 430px;
  overflow-y: auto;
}

@media (max-width: 991px) {
  .consultation-room-header,
  .consultation-room-grid {
    grid-template-columns: 1fr;
  }

  .consultation-room-header {
    flex-direction: column;
  }

  .consultation-room-meta {
    justify-items: start;
  }

  .media-stage,
  .remote-video-wrap,
  .remote-video {
    min-height: 420px;
  }

  .call-controls {
    position: static;
    margin: 1rem;
  }

  .local-video-wrap {
    top: 4.75rem;
    bottom: auto;
  }
}

.auth-link {
  color: var(--teal-600);
  text-decoration: underline;
  font-weight: 600;
}

.auth-link:hover {
  color: var(--ink-900);
}
