:root {
  --portal-accent: #164f86;
  --portal-accent-soft: rgba(22, 79, 134, 0.15);
  --portal-accent-deep: #071d36;
  --portal-surface: #dce8f5;
  --portal-panel: rgba(255, 255, 255, 0.9);
  --portal-ink: #071527;
  --portal-muted: #435a73;
  --portal-navy: #071d36;
  --portal-navy-mid: #0d3560;
  --portal-navy-light: #164f86;
  --portal-white-blue: #f5f9ff;
}

html {
  font-size: 14px;
}

body {
  background:
    radial-gradient(circle at top right, rgba(54, 111, 177, 0.28), transparent 28%),
    radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #031226 0%, #071d36 46%, #020817 100%);
  color: #f8fbff;
  min-height: 100vh;
}

body.bg-body-tertiary {
  background:
    radial-gradient(circle at top right, rgba(54, 111, 177, 0.28), transparent 28%),
    radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #031226 0%, #071d36 46%, #020817 100%) !important;
}

.bg-white {
  background:
    linear-gradient(135deg, rgba(8, 29, 54, 0.98) 0%, rgba(13, 53, 96, 0.96) 58%, rgba(22, 79, 134, 0.9) 100%) !important;
}

.bg-body-tertiary {
  background-color: #071d36 !important;
}

.portal-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(5px);
}

.portal-loader-overlay.is-active {
  display: flex;
}

.portal-loader-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(420px, 100%);
  padding: 1rem 1.1rem;
  border: 1px solid rgba(7, 29, 54, 0.14);
  border-radius: 8px;
  background: #071d36;
  color: #f8fbff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.28);
}

.portal-loader-spinner {
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  border: 4px solid #dbeafe;
  border-top-color: var(--portal-accent);
  border-radius: 50%;
  animation: portal-loader-spin 0.8s linear infinite;
}

.portal-loader-title {
  color: #f8fbff;
  font-weight: 800;
}

.portal-loader-message {
  color: #334155;
  font-size: 0.9rem;
}

@keyframes portal-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.app-wrapper {
  display: block;
  min-height: 100vh;
}

.app-content {
  min-height: calc(100vh - 76px);
}

.app-main {
  margin-left: 280px !important;
  min-height: 100vh;
}

.app-sidebar {
  width: 280px !important;
  min-width: 280px !important;
  max-width: 280px !important;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  background:
    radial-gradient(circle at top left, rgba(76, 134, 196, 0.26), transparent 34%),
    linear-gradient(180deg, #071d36 0%, #0d3560 50%, #061729 100%) !important;
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(255,255,255,0.12);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 1030;
}

.app-sidebar.bg-primary-subtle {
  background:
    radial-gradient(circle at top left, rgba(76, 134, 196, 0.26), transparent 34%),
    linear-gradient(180deg, #071d36 0%, #0d3560 50%, #061729 100%) !important;
}

.app-header {
  margin-left: 280px !important;
  backdrop-filter: blur(14px);
}

.fas,
.fa-solid,
.far,
.fa-regular,
.fab,
.fa-brands {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", FontAwesome, sans-serif !important;
}

.fas,
.fa-solid {
  font-weight: 900 !important;
}

.far,
.fa-regular,
.fab,
.fa-brands {
  font-weight: 400 !important;
}

.nav-sidebar .nav-link {
  border-radius: 0.85rem;
  padding: 0.8rem 0.9rem;
  font-weight: 600;
}

.nav-sidebar .nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.sidebar-brand-shell {
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.06) 100%);
  backdrop-filter: blur(10px);
}

.sidebar-brand-badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--portal-accent-deep) 0%, var(--portal-accent) 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(7, 29, 54, 0.24);
}

.sidebar-brand-subtitle {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.68);
  letter-spacing: 0.03em;
}

.sidebar-group-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.58) !important;
  font-weight: 700;
}

.sidebar-group-workspace {
  color: #b9d8ff !important;
}

.sidebar-group-clinical {
  color: #d8e9ff !important;
}

.sidebar-group-exchange {
  color: #c9ddf5 !important;
}

.sidebar-group-governance {
  color: #edf5ff !important;
}

.app-sidebar .text-dark,
.app-sidebar .fw-semibold,
.app-sidebar .brand-text {
  color: #fff !important;
}

.app-sidebar .text-muted,
.app-sidebar .small.text-muted {
  color: rgba(255,255,255,0.66) !important;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.58rem 0.72rem !important;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.86) !important;
  transition: all 0.16s ease;
}

.sidebar-link:hover {
  transform: translateX(2px);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(7, 29, 54, 0.98) 0%, rgba(13, 53, 96, 0.96) 52%, rgba(22, 79, 134, 0.94) 100%);
  color: #fff !important;
  box-shadow: 0 14px 26px rgba(7, 29, 54, 0.24);
}

.sidebar-link.active .sidebar-link-pill {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

.sidebar-link-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,0.12);
  color: #eaf3ff;
  flex: 0 0 auto;
  font-size: 0.82rem;
}

.sidebar-link-workspace .sidebar-link-icon {
  background: rgba(255,255,255,0.12);
  color: #d8e9ff;
}

.sidebar-link-clinical .sidebar-link-icon {
  background: rgba(255,255,255,0.12);
  color: #d8e9ff;
}

.sidebar-link-exchange .sidebar-link-icon {
  background: rgba(255,255,255,0.12);
  color: #d8e9ff;
}

.sidebar-link-governance .sidebar-link-icon {
  background: rgba(255,255,255,0.12);
  color: #d8e9ff;
}

.sidebar-link-workspace:hover {
  background: linear-gradient(90deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.07) 100%);
}

.sidebar-link-clinical:hover {
  background: linear-gradient(90deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.07) 100%);
}

.sidebar-link-exchange:hover {
  background: linear-gradient(90deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.07) 100%);
}

.sidebar-link-governance:hover {
  background: linear-gradient(90deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.07) 100%);
}

.sidebar-link.active .sidebar-link-icon {
  background: rgba(255,255,255,0.16);
  color: #fff;
}

.sidebar-link-text {
  flex: 1 1 auto;
  line-height: 1.15;
  font-size: 0.93rem;
}

.sidebar-link-pill {
  font-size: 0.64rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 0.18rem 0.42rem;
}

.sidebar-link-workspace .sidebar-link-pill {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.sidebar-link-clinical .sidebar-link-pill {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.sidebar-link-exchange .sidebar-link-pill {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.sidebar-link-governance .sidebar-link-pill {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.sidebar-empty-state {
  padding: 1.25rem 1rem;
  border-radius: 1.2rem;
  background: rgba(255,255,255,0.08);
  border: 1px dashed rgba(255,255,255,0.22);
  text-align: center;
}

.sidebar-empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.85rem;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.15rem;
}

.sidebar-footer {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  margin-top: auto;
}

.sidebar-user-card {
  padding: 0.95rem;
  border-radius: 1rem;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.12);
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--portal-accent-deep) 0%, var(--portal-accent) 100%);
  color: #fff;
  font-weight: 700;
  flex: 0 0 auto;
}

.sidebar-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sidebar-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-logout-button {
  border-radius: 0.95rem;
  padding: 0.72rem 0.95rem;
  font-weight: 700;
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar-logout-button:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.34);
  color: #fff;
}

.stat-card {
  overflow: hidden;
  position: relative;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(22, 79, 134, 0.2), transparent 60%);
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(22, 79, 134, 0.18), transparent 20%),
    radial-gradient(circle at 88% 18%, rgba(7, 29, 54, 0.16), transparent 22%),
    linear-gradient(135deg, rgba(255,255,255,0.99) 0%, rgba(246,250,255,0.97) 46%, rgba(222,233,247,0.95) 100%);
  box-shadow: 0 24px 44px rgba(7, 29, 54, 0.14);
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, rgba(255,255,255,0.18) 0%, transparent 36%),
    linear-gradient(180deg, rgba(7, 29, 54, 0.02), transparent 45%);
  pointer-events: none;
}

.dashboard-hero-copy,
.dashboard-hero-actions {
  position: relative;
  z-index: 1;
}

.dashboard-hero-copy {
  max-width: 760px;
}

.dashboard-hero-button {
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 700;
}

.dashboard-hero-button-soft {
  background: rgba(255,255,255,0.7);
  border-color: rgba(22, 79, 134, 0.2);
}

.dashboard-stat-card {
  border-radius: 1.35rem;
  background: linear-gradient(180deg, rgba(7, 29, 54, 0.98) 0%, rgba(4, 19, 38, 0.96) 100%) !important;
  color: #f8fbff !important;
  box-shadow: 0 18px 34px rgba(7, 29, 54, 0.09);
}

.dashboard-stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--portal-navy) 0%, var(--portal-accent) 100%);
}

.dashboard-stat-card-primary::before {
  background: linear-gradient(90deg, var(--portal-navy-mid) 0%, var(--portal-accent) 100%);
}

.dashboard-stat-card-danger::before {
  background: linear-gradient(90deg, #7f1d1d 0%, #dc2626 100%);
}

.dashboard-stat-card-teal::before {
  background: linear-gradient(90deg, #0b3b66 0%, #2563eb 100%);
}

.dashboard-stat-card-amber::before {
  background: linear-gradient(90deg, #92400e 0%, #d97706 100%);
}

.dashboard-stat-label {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c8daf0 !important;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.dashboard-stat-value {
  font-size: clamp(2rem, 3vw, 2.65rem);
  line-height: 1;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: #ffffff !important;
}

.dashboard-stat-meta {
  color: #c8daf0 !important;
  line-height: 1.45;
  max-width: 28ch;
}

.dashboard-stat-card .text-danger,
.dashboard-stat-card .text-warning {
  color: #ffffff !important;
}

.dashboard-panel-card {
  border-radius: 1.4rem;
  overflow: hidden;
}

.dashboard-panel-header {
  border-bottom: 1px solid rgba(7, 29, 54, 0.08);
}

.dashboard-document-status-badge {
  color: #f8fbff !important;
}

.dashboard-focus-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(246,250,255,0.96) 100%);
}

.dashboard-widget-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  min-height: 100%;
  padding: 1rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(7, 29, 54, 0.08);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 14px 28px rgba(7, 29, 54, 0.07);
}

.dashboard-widget-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--portal-accent-deep);
  flex: 0 0 auto;
}

.dashboard-widget-imports .dashboard-widget-icon {
  background: #6ea8fe;
}

.dashboard-widget-reconcile .dashboard-widget-icon {
  background: #8bbcff;
}

.dashboard-widget-canonical .dashboard-widget-icon {
  background: #9fc7ff;
}

.dashboard-widget-corrections .dashboard-widget-icon {
  background: #7fb4ff;
}

.dashboard-widget-label {
  color: var(--portal-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-widget-value {
  margin: 0.25rem 0;
  color: #f8fbff;
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 850;
}

.dashboard-widget-meta {
  color: var(--portal-muted);
  line-height: 1.35;
}

.dashboard-progress-metric {
  display: grid;
  gap: 0.65rem;
}

.dashboard-progress {
  height: 0.62rem;
  border-radius: 999px;
  background: #e2e8f0;
}

.dashboard-progress .progress-bar {
  background: linear-gradient(90deg, #164f86 0%, #10b981 100%);
}

.dashboard-mini-list {
  display: grid;
  gap: 0.75rem;
}

.dashboard-mini-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.68rem 0;
  border-bottom: 1px solid rgba(7, 29, 54, 0.08);
}

.dashboard-mini-list span {
  color: var(--portal-muted);
  font-weight: 700;
}

.dashboard-mini-list strong {
  color: #f8fbff;
  font-size: 1.2rem;
}

.dashboard-activity-list {
  display: grid;
  gap: 0.85rem;
  max-height: 360px;
  overflow-y: auto;
}

.dashboard-activity-item {
  padding: 0.8rem;
  border: 1px solid rgba(7, 29, 54, 0.08);
  border-radius: 0.8rem;
  background: #071d36;
}

.dashboard-activity-type {
  color: var(--portal-accent-deep);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-activity-description {
  margin-top: 0.25rem;
  color: #f8fbff;
  overflow-wrap: anywhere;
}

.dashboard-activity-meta {
  margin-top: 0.35rem;
  color: var(--portal-muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.settings-page-shell {
  position: relative;
}

.settings-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at 10% 18%, rgba(255, 186, 73, 0.22), transparent 18%),
    radial-gradient(circle at 88% 20%, rgba(22, 79, 134, 0.24), transparent 22%),
    linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(246,250,255,0.96) 48%, rgba(237,247,252,0.94) 100%);
  box-shadow: 0 24px 44px rgba(7, 29, 54, 0.12);
}

.settings-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, rgba(255,255,255,0.18) 0%, transparent 36%),
    linear-gradient(180deg, rgba(7, 29, 54, 0.02), transparent 45%);
  pointer-events: none;
}

.settings-hero-copy,
.settings-hero-actions {
  position: relative;
  z-index: 1;
}

.settings-hero-copy {
  max-width: 760px;
}

.settings-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: rgba(255,255,255,0.74);
  color: var(--portal-accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(22, 79, 134, 0.12);
  box-shadow: 0 10px 22px rgba(7, 29, 54, 0.08);
}

.settings-save-button {
  border-radius: 999px;
  padding: 0.58rem 1rem;
  font-weight: 700;
}

.settings-section-card {
  border-radius: 1.45rem;
  overflow: hidden;
}

.settings-section-header {
  border-bottom: 1px solid rgba(7, 29, 54, 0.08);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.98) 0%, rgba(244,249,252,0.96) 100%) !important;
}

.settings-section-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(7, 29, 54, 0.96) 0%, rgba(22, 79, 134, 0.92) 100%);
  color: #fff;
  box-shadow: 0 16px 28px rgba(7, 29, 54, 0.16);
  flex: 0 0 auto;
}

.settings-input-card {
  border-radius: 1.2rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,251,254,0.96) 100%);
  border: 1px solid rgba(7, 29, 54, 0.06);
  box-shadow: 0 16px 30px rgba(7, 29, 54, 0.06);
}

.settings-type-badge {
  background: rgba(22, 79, 134, 0.10);
  color: var(--portal-accent-deep);
  border: 1px solid rgba(22, 79, 134, 0.14);
  font-weight: 700;
}

.settings-input {
  border-radius: 0.95rem;
  border-color: rgba(7, 29, 54, 0.10);
  min-height: 44px;
  background: rgba(255,255,255,0.92);
}

.settings-input:focus {
  border-color: rgba(22, 79, 134, 0.42);
  box-shadow: 0 0 0 0.2rem rgba(22, 79, 134, 0.12);
}

.canonical-backfill-page {
  position: relative;
}

.canonical-backfill-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 186, 73, 0.22), transparent 18%),
    radial-gradient(circle at 88% 20%, rgba(22, 79, 134, 0.24), transparent 22%),
    linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(246,250,255,0.96) 48%, rgba(237,247,252,0.94) 100%);
  box-shadow: 0 24px 44px rgba(7, 29, 54, 0.12);
}

.canonical-backfill-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, rgba(255,255,255,0.18) 0%, transparent 36%),
    linear-gradient(180deg, rgba(7, 29, 54, 0.02), transparent 45%);
  pointer-events: none;
}

.canonical-backfill-copy,
.canonical-backfill-action {
  position: relative;
  z-index: 1;
}

.canonical-backfill-copy {
  max-width: 760px;
}

.canonical-backfill-run {
  border-radius: 999px;
  padding: 0.62rem 1.05rem;
  font-weight: 800;
}

.canonical-backfill-stat {
  border-radius: 1.25rem;
  overflow: hidden;
  background: rgba(255,255,255,0.92);
}

.canonical-backfill-stat::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, #2563eb 0%, #164f86 100%);
}

.canonical-backfill-stat-label {
  color: #6b7f92;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.canonical-backfill-stat-value {
  color: var(--portal-ink);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.55rem;
}

.canonical-backfill-panel {
  border-radius: 1.35rem;
  overflow: hidden;
}

.canonical-backfill-instructions {
  border-radius: 1.35rem;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(244,249,252,0.96) 100%);
}

.canonical-backfill-instructions-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--portal-accent-deep) 0%, var(--portal-accent) 100%);
  box-shadow: 0 16px 28px rgba(7, 29, 54, 0.16);
  flex: 0 0 auto;
}

.canonical-backfill-check {
  height: 100%;
  padding: 0.9rem;
  border: 1px solid rgba(22, 79, 134, 0.12);
  border-radius: 0.95rem;
  background: rgba(255,255,255,0.72);
}

.canonical-backfill-check code,
.canonical-backfill-note code {
  color: #0f4c5c;
  background: rgba(22, 79, 134, 0.08);
  border-radius: 0.35rem;
  padding: 0.08rem 0.28rem;
}

.canonical-backfill-note {
  padding: 0.8rem 0.9rem;
  border-radius: 0.9rem;
  color: var(--portal-accent-deep);
  background: rgba(22, 79, 134, 0.08);
  font-weight: 700;
}

.canonical-backfill-panel .card-header {
  border-bottom: 1px solid rgba(7, 29, 54, 0.08);
}

.canonical-backfill-result-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.canonical-backfill-table-wrap {
  width: 100%;
}

.canonical-backfill-table {
  min-width: 1080px;
  table-layout: fixed;
}

.canonical-backfill-table th {
  color: #fff;
  background: var(--portal-accent-deep);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.canonical-backfill-table td {
  overflow-wrap: anywhere;
  vertical-align: top;
}

.canonical-backfill-status-cell,
.canonical-backfill-status-cell *,
.canonical-backfill-rawxml-cell,
.canonical-backfill-rawxml-cell * {
  color: #f8fbff !important;
}

.canonical-backfill-blocked-mini {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  color: #f8fbff;
  background: #ffedd5;
  font-size: 0.78rem;
  font-weight: 800;
}

.canonical-backfill-blocked-panel {
  border-top: 4px solid #8bbcff !important;
}

.canonical-backfill-blocked-table {
  min-width: 1160px;
}

.canonical-backfill-validation-detail {
  color: #f8fbff;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.45;
}

.canonical-backfill-details-button {
  white-space: nowrap;
}

.canonical-backfill-detail-label {
  margin-bottom: 0.25rem;
  color: #5f6f7d;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.canonical-backfill-detail-value {
  min-height: 2.65rem;
  padding: 0.68rem 0.8rem;
  border: 1px solid rgba(7, 29, 54, 0.1);
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--portal-ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.canonical-backfill-detail-long {
  max-height: 22rem;
  overflow: auto;
  font-family: var(--bs-font-sans-serif);
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.canonical-backfill-empty {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px dashed rgba(22, 79, 134, 0.22);
  border-radius: 1rem;
  background: rgba(22, 79, 134, 0.05);
}

.canonical-backfill-empty-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  color: #6ea8fe;
  background: rgba(16, 185, 129, 0.12);
  flex: 0 0 auto;
}

.xml-preview {
  width: 100%;
  max-width: 100%;
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overscroll-behavior: contain;
}

.xml-search-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.xml-search-input {
  max-width: 360px;
}

.xml-searchable-preview code {
  display: block;
  min-width: max-content;
  white-space: pre;
}

.xml-search-hit {
  background: #ffe58f;
  color: #1f2937;
  padding: 0 0.1rem;
  border-radius: 0.15rem;
}

.document-status-badge {
  color: #f8fbff !important;
}

.document-grid-search {
  max-width: 520px;
}

.document-detail-hero,
.document-detail-workspace,
.document-detail-rail,
.document-xml-viewer-card {
  border-radius: 1.35rem;
  overflow: hidden;
}

.document-detail-workspace,
.document-xml-viewer-card,
.document-detail-tab-content,
.document-detail-tab-content .tab-pane,
.document-xslt-preview,
.xml-preview {
  min-width: 0;
}

.document-detail-hero {
  background:
    radial-gradient(circle at 90% 12%, rgba(22, 79, 134, 0.18), transparent 26%),
    radial-gradient(circle at 12% 18%, rgba(45, 156, 219, 0.16), transparent 20%),
    linear-gradient(135deg, rgba(255,255,255,0.99) 0%, rgba(241,249,255,0.97) 55%, rgba(232,247,252,0.94) 100%);
}

.document-detail-hero-copy {
  max-width: 760px;
}

.document-detail-actions .btn,
.document-detail-tabs .nav-link {
  border-radius: 999px;
}

.document-detail-type-badge {
  color: #f8fbff;
}

.document-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
}

.document-detail-meta-card {
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(22, 79, 134, 0.10);
}

.document-detail-tab-content {
  border: 1px solid rgba(7, 29, 54, 0.08);
  border-radius: 1.1rem;
  padding: 1rem;
  background: rgba(248, 251, 254, 0.72);
  max-width: 100%;
  overflow: visible;
}

.document-detail-tab-content > .tab-pane,
.document-detail-tab-content .tab-content,
.document-detail-tab-content .tab-pane > * {
  max-width: 100%;
}

.document-xslt-preview {
  width: 100%;
  max-width: 100%;
  max-height: 58vh;
  overflow: auto;
  padding: 1rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(7, 29, 54, 0.08);
  background: #071d36;
  overscroll-behavior: contain;
}

.document-xslt-preview .ccda-print-document {
  box-shadow: none;
  border-radius: 1rem;
  min-width: 980px;
}

.document-xslt-preview-standalone {
  max-height: 76vh;
}

.document-detail-workspace table,
.document-detail-workspace th,
.document-detail-workspace td,
.document-detail-workspace td *,
.document-detail-workspace code,
.document-detail-workspace .fw-semibold,
.document-detail-meta-card .fw-semibold,
.document-xml-viewer-card table,
.document-xml-viewer-card th,
.document-xml-viewer-card td,
.document-xml-viewer-card td *,
.document-xml-viewer-card code,
.document-xml-viewer-card .fw-semibold {
  color: #f8fbff !important;
}

.document-detail-workspace table .text-muted,
.document-xml-viewer-card table .text-muted {
  color: #f8fbff !important;
}

.document-narrative-preview {
  width: 100%;
  max-width: 100%;
  max-height: 70vh;
  overflow: auto;
  overscroll-behavior: contain;
}

.document-narrative-preview > * {
  max-width: 100%;
}

.document-narrative-preview table {
  min-width: max-content;
}

.document-narrative-preview td,
.document-narrative-preview td *,
.document-xslt-preview td,
.document-xslt-preview td *,
.document-xslt-preview th,
.document-xslt-preview th * {
  color: #f8fbff !important;
}

.document-xml-viewer-card #viewer-raw-tab .xml-preview,
.document-xml-viewer-card #viewer-raw-tab .xml-preview code {
  color: #fff !important;
}

.document-xml-viewer-card #viewer-mu3-tab .document-xslt-preview thead th,
.document-xml-viewer-card #viewer-mu3-tab .document-xslt-preview thead th *,
.document-xml-viewer-card #viewer-mu3-tab .document-xslt-preview .ccda-narrative thead th,
.document-xml-viewer-card #viewer-mu3-tab .document-xslt-preview .ccda-narrative thead th * {
  color: #fff !important;
}

.document-export-package-card .fw-semibold,
.document-export-package-card table,
.document-export-package-card th,
.document-export-package-card td,
.document-export-package-card td *,
.document-export-package-card code {
  color: #f8fbff !important;
}

.document-export-package-card #export-raw-tab .xml-preview,
.document-export-package-card #export-raw-tab .xml-preview code {
  color: #fff !important;
}

.document-export-package-card #export-mu3-tab .document-xslt-preview thead th,
.document-export-package-card #export-mu3-tab .document-xslt-preview thead th *,
.document-export-package-card #export-mu3-tab .document-xslt-preview .ccda-narrative thead th,
.document-export-package-card #export-mu3-tab .document-xslt-preview .ccda-narrative thead th * {
  color: #fff !important;
}

/* Document details page dark synchronization. */
.document-detail-hero,
.document-detail-workspace,
.document-detail-rail,
.document-detail-meta-card,
.document-detail-tab-content {
  background:
    linear-gradient(180deg, rgba(7, 29, 54, 0.98) 0%, rgba(4, 19, 38, 0.96) 100%) !important;
  border-color: rgba(166, 200, 241, 0.18) !important;
  color: #f8fbff !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.document-detail-hero {
  position: relative;
}

.document-detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 14%, rgba(110, 168, 254, 0.18), transparent 24%),
    radial-gradient(circle at 12% 18%, rgba(22, 79, 134, 0.24), transparent 22%);
}

.document-detail-hero > *,
.document-detail-workspace > *,
.document-detail-rail > * {
  position: relative;
  z-index: 1;
}

.document-detail-hero *,
.document-detail-workspace *,
.document-detail-rail *,
.document-detail-meta-card * {
  color: #f8fbff !important;
}

.document-detail-hero .text-muted,
.document-detail-workspace .text-muted,
.document-detail-rail .text-muted,
.document-detail-meta-card .text-muted {
  color: #c8daf0 !important;
}

.document-detail-meta-card {
  border-radius: 0.95rem;
}

.document-detail-rail .card-header,
.document-detail-rail .bg-white {
  background: linear-gradient(90deg, rgba(13, 53, 96, 0.98) 0%, rgba(22, 79, 134, 0.92) 100%) !important;
  border-color: rgba(166, 200, 241, 0.18) !important;
}

.document-detail-type-badge {
  background: rgba(110, 168, 254, 0.18) !important;
  border-color: rgba(166, 200, 241, 0.28) !important;
  color: #f8fbff !important;
}

.timeline-item {
  border-color: #6ea8fe !important;
}

.document-narrative-preview pre,
.document-narrative-preview code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.audit-log-table-wrap {
  width: 100%;
}

.audit-search-form {
  border: 1px solid rgba(7, 29, 54, 0.08);
  border-radius: 0.75rem;
  padding: 1rem;
  background: rgba(248, 251, 254, 0.72);
}

.audit-log-table {
  min-width: 1080px;
  table-layout: fixed;
}

.audit-log-time {
  width: 150px;
}

.audit-log-event {
  width: 190px;
}

.audit-log-entity {
  width: 260px;
}

.audit-log-ip {
  width: 120px;
}

.audit-log-description {
  width: auto;
}

.audit-log-entity-cell,
.audit-log-description-cell,
.audit-log-ip-cell,
.audit-log-id {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-log-description-cell {
  white-space: normal;
  line-height: 1.45;
}

.audit-log-event-badge {
  max-width: 100%;
  white-space: normal;
  text-align: left;
  color: #f8fbff !important;
}

.audit-log-row {
  cursor: pointer;
}

.audit-log-row:focus {
  outline: 2px solid rgba(13, 110, 253, 0.35);
  outline-offset: -2px;
}

.audit-log-details-button {
  white-space: nowrap;
}

.audit-detail-grid {
  color: var(--portal-ink);
}

.audit-detail-label {
  margin-bottom: 0.25rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5f6f7d;
}

.audit-detail-value {
  min-height: 2.6rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(7, 29, 54, 0.1);
  border-radius: 8px;
  background: #f8fbfe;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-detail-description {
  min-height: 7rem;
  max-height: 20rem;
  padding: 0.85rem;
  border: 1px solid rgba(7, 29, 54, 0.1);
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--portal-ink);
  font-family: var(--bs-font-sans-serif);
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow: auto;
  overflow-wrap: anywhere;
}

.validation-findings-table,
.validation-findings-table th,
.validation-findings-table td,
.validation-findings-table td *,
.validation-findings-table code,
.validation-findings-table .text-muted,
.validation-severity-badge {
  color: #f8fbff !important;
}

.validation-empty-state {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 8px;
  background: rgba(240, 253, 250, 0.78);
  color: var(--portal-ink);
}

.validation-empty-icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #6ea8fe;
  background: #ccfbf1;
}

.validation-empty-state h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--portal-accent-deep);
}

.validation-empty-state p {
  margin: 0;
  color: var(--portal-muted);
  line-height: 1.55;
}

.validation-paste-textarea {
  min-height: 34rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.5;
}

.searchable-select {
  display: grid;
  gap: 0.35rem;
}

.searchable-select-input {
  border-color: rgba(22, 79, 134, 0.2);
  background: rgba(248, 251, 254, 0.92);
}

.ccda-narrative {
  display: grid;
  gap: 1rem;
  color: var(--portal-ink);
}

.ccda-render-header {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid rgba(22, 79, 134, 0.16);
  border-radius: 1.2rem;
  background: linear-gradient(135deg, rgba(230, 247, 252, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 18px 34px rgba(7, 29, 54, 0.07);
}

.ccda-render-header h2 {
  margin: 0.2rem 0 0.35rem;
  color: var(--portal-accent-deep);
  font-size: 1.45rem;
  font-weight: 800;
}

.ccda-render-kicker,
.ccda-render-meta-label,
.ccda-section-index-title {
  color: var(--portal-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ccda-render-subtitle {
  color: var(--portal-muted);
  font-weight: 600;
}

.ccda-render-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.ccda-render-meta-card {
  padding: 0.8rem;
  border: 1px solid rgba(7, 29, 54, 0.08);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.78);
}

.ccda-render-meta-value {
  margin-top: 0.15rem;
  color: var(--portal-ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ccda-render-meta-note {
  margin-top: 0.25rem;
  color: var(--portal-muted);
  font-size: 0.83rem;
  overflow-wrap: anywhere;
}

.ccda-section-index {
  padding: 1rem;
  border: 1px solid rgba(7, 29, 54, 0.08);
  border-radius: 1rem;
  background: #071d36;
}

.ccda-section-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.ccda-section-index-item {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(22, 79, 134, 0.14);
  border-radius: 0.75rem;
  background: rgba(22, 79, 134, 0.04);
}

.ccda-section-index-name {
  color: var(--portal-ink);
  font-weight: 800;
}

.ccda-section-index-code,
.ccda-section-meta {
  color: var(--portal-muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.ccda-section-meta {
  margin-top: 0.35rem;
}

.ccda-entry-fallback {
  padding: 0.85rem;
  border-radius: 0.8rem;
  background: rgba(22, 79, 134, 0.06);
  color: var(--portal-ink);
  white-space: pre-wrap;
}

.ccda-section {
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(247,250,252,0.96) 100%);
  border: 1px solid rgba(7, 29, 54, 0.08);
  border-radius: 1.2rem;
  overflow: hidden;
  box-shadow: 0 18px 32px rgba(7, 29, 54, 0.06);
}

.ccda-section-header {
  padding: 0.95rem 1.1rem 0.8rem;
  border-bottom: 1px solid rgba(7, 29, 54, 0.08);
  background: linear-gradient(90deg, rgba(22, 79, 134, 0.08) 0%, rgba(22, 79, 134, 0.02) 100%);
}

.ccda-section-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--portal-accent-deep);
}

@media (max-width: 767.98px) {
  .ccda-render-header,
  .ccda-render-meta-grid {
    grid-template-columns: 1fr;
  }
}

.ccda-section-body {
  padding: 1rem 1.1rem 1.1rem;
  max-width: 100%;
  overflow-x: auto;
}

.ccda-narrative table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 1rem;
}

.ccda-narrative thead th {
  background: rgba(7, 29, 54, 0.92);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.78rem 0.9rem;
  border: 0;
  overflow-wrap: anywhere;
}

.ccda-narrative tbody td {
  padding: 0.82rem 0.9rem;
  border-bottom: 1px solid rgba(7, 29, 54, 0.08);
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
}

.ccda-narrative tbody tr:nth-child(even) td {
  background: rgba(22, 79, 134, 0.03);
}

.ccda-narrative tbody tr:last-child td {
  border-bottom: 0;
}

.ccda-narrative p,
.ccda-narrative ul,
.ccda-narrative ol {
  margin-bottom: 0.9rem;
}

.ccda-narrative ul,
.ccda-narrative ol {
  padding-left: 1.25rem;
}

.ccda-empty-state {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(22, 79, 134, 0.08);
  color: var(--portal-muted);
}

.guide-nav-card {
  top: 1rem;
}

.guide-hero,
.guide-document {
  border-radius: 1.1rem;
  overflow: hidden;
}

.guide-purpose-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.1rem;
  padding: 1.5rem;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(7, 29, 54, 0.99) 0%, rgba(13, 53, 96, 0.98) 54%, rgba(22, 79, 134, 0.96) 100%);
  box-shadow: 0 1rem 2rem rgba(7, 29, 54, 0.2);
}

.guide-purpose-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 3rem 3rem;
  opacity: 0.16;
  pointer-events: none;
}

.guide-purpose-card > * {
  position: relative;
  z-index: 1;
}

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

.guide-purpose-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.65rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: #dffcff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.guide-purpose-header h2 {
  margin: 0 0 0.65rem;
  font-size: 1.75rem;
  font-weight: 800;
}

.guide-purpose-header p {
  max-width: 46rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.65;
}

.guide-purpose-emblem {
  flex: 0 0 auto;
  width: 4.25rem;
  height: 4.25rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-size: 1.6rem;
}

.guide-purpose-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.guide-purpose-tile {
  min-height: 100%;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.94);
  color: var(--portal-ink);
}

.guide-purpose-icon {
  width: 2.6rem;
  height: 2.6rem;
  display: inline-grid;
  place-items: center;
  margin-bottom: 0.85rem;
  border-radius: 0.75rem;
  color: #ffffff;
  font-size: 1.05rem;
}

.guide-purpose-icon-teal {
  background: #164f86;
}

.guide-purpose-icon-amber {
  background: #7fb4ff;
}

.guide-purpose-icon-green {
  background: #7fb4ff;
}

.guide-purpose-tile h3 {
  margin: 0 0 0.55rem;
  color: var(--portal-accent-deep);
  font-size: 1rem;
  font-weight: 800;
}

.guide-purpose-tile p {
  margin: 0;
  color: var(--portal-muted);
  line-height: 1.55;
}

.guide-purpose-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0.7rem;
  margin: 1rem 0;
}

.guide-purpose-flow-step {
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.12);
}

.guide-purpose-flow-step span {
  display: block;
  margin-bottom: 0.25rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.guide-purpose-flow-step strong {
  display: block;
  color: #ffffff;
  font-size: 0.92rem;
  line-height: 1.35;
}

.guide-purpose-flow-hub {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.guide-purpose-flow-arrow {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
}

.guide-purpose-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.guide-purpose-split > div {
  padding: 1rem;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.13);
}

.guide-purpose-split h3 {
  margin: 0 0 0.45rem;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 800;
}

.guide-purpose-split p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.guide-purpose-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.guide-purpose-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.11);
  font-size: 0.85rem;
  font-weight: 700;
}

.guide-nav-feature {
  color: #0f4c5c;
  font-weight: 800;
  background: rgba(22, 79, 134, 0.08);
}

.guide-flows-section {
  border-radius: 1.1rem;
  overflow: hidden;
}

.guide-flows-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  color: #fff;
  background: linear-gradient(135deg, #071d36 0%, #164f86 54%, #7fb4ff 100%);
}

.guide-flow-kicker,
.guide-flow-label {
  color: #6b7f92;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guide-flows-intro .guide-flow-kicker {
  color: rgba(255,255,255,0.72);
}

.guide-flows-intro h2 {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.55rem;
  line-height: 1.15;
  font-weight: 850;
}

.guide-flows-intro p {
  max-width: 68ch;
  margin: 0;
  color: rgba(255,255,255,0.84);
}

.guide-flow-count {
  display: grid;
  place-items: center;
  min-width: 6rem;
  min-height: 6rem;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 1rem;
  background: rgba(255,255,255,0.16);
}

.guide-flow-count strong {
  font-size: 2rem;
  line-height: 1;
}

.guide-flow-count span {
  color: rgba(255,255,255,0.78);
  font-weight: 800;
}

.guide-flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1rem;
}

.guide-flow-card {
  position: relative;
  display: grid;
  gap: 1rem;
  align-content: start;
  min-height: 100%;
  padding: 1rem;
  border: 1px solid rgba(7, 29, 54, 0.08);
  border-top: 5px solid #164f86;
  border-radius: 1rem;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 14px 28px rgba(7, 29, 54, 0.07);
}

.guide-flow-card-teal { border-top-color: #6ea8fe; }
.guide-flow-card-amber { border-top-color: #7fb4ff; }
.guide-flow-card-blue { border-top-color: #0369a1; }
.guide-flow-card-green { border-top-color: #7fb4ff; }
.guide-flow-card-purple { border-top-color: #9fc7ff; }
.guide-flow-card-red { border-top-color: #b91c1c; }

.guide-flow-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.guide-flow-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0.85rem;
  color: #fff;
  background: var(--portal-accent-deep);
}

.guide-flow-card-teal .guide-flow-icon { background: #6ea8fe; }
.guide-flow-card-amber .guide-flow-icon { background: #7fb4ff; }
.guide-flow-card-blue .guide-flow-icon { background: #0369a1; }
.guide-flow-card-green .guide-flow-icon { background: #7fb4ff; }
.guide-flow-card-purple .guide-flow-icon { background: #9fc7ff; }
.guide-flow-card-red .guide-flow-icon { background: #b91c1c; }

.guide-flow-card h4 {
  margin: 0 0 0.25rem;
  color: var(--portal-ink);
  font-size: 1.05rem;
  font-weight: 850;
}

.guide-flow-card p {
  margin: 0;
  color: var(--portal-muted);
  line-height: 1.35;
}

.guide-chip-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.guide-chip-flow span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  color: #071d36;
  background: #eef6f8;
  border: 1px solid rgba(22, 79, 134, 0.14);
  font-size: 0.8rem;
  font-weight: 800;
}

.guide-chip-flow span:not(:last-child)::after {
  content: "\f061";
  margin-left: 0.55rem;
  color: #164f86;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.68rem;
}

.guide-flow-content {
  display: grid;
  gap: 0.85rem;
}

.guide-flow-steps,
.guide-flow-examples {
  padding: 0.85rem;
  border-radius: 0.85rem;
  background: #071d36;
  border: 1px solid #e2e8f0;
}

.guide-flow-steps ol {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
}

.guide-flow-steps li {
  margin-bottom: 0.35rem;
  color: var(--portal-ink);
  line-height: 1.42;
}

.guide-flow-examples > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.guide-flow-examples span {
  display: inline-flex;
  max-width: 100%;
  padding: 0.25rem 0.5rem;
  border-radius: 0.45rem;
  color: #0f4c5c;
  background: rgba(22, 79, 134, 0.08);
  font-size: 0.78rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.guide-flow-route {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  max-width: 100%;
  padding: 0.46rem 0.75rem;
  border: 1px solid rgba(7, 29, 54, 0.12);
  border-radius: 999px;
  color: var(--portal-accent-deep);
  background: #071d36;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.guide-flow-route:hover {
  color: #fff;
  background: var(--portal-accent-deep);
}

@media (max-width: 991.98px) {
  .guide-purpose-header {
    flex-direction: column;
  }

  .guide-purpose-grid,
  .guide-purpose-split {
    grid-template-columns: 1fr;
  }

  .guide-purpose-flow {
    grid-template-columns: 1fr;
  }

  .guide-purpose-flow-arrow {
    min-height: 1.5rem;
    transform: rotate(90deg);
  }

  .guide-flows-intro {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .guide-purpose-card {
    padding: 1rem;
  }

  .guide-purpose-header h2 {
    font-size: 1.35rem;
  }

  .guide-purpose-emblem {
    width: 3.4rem;
    height: 3.4rem;
    font-size: 1.25rem;
  }
}

.guide-content {
  color: var(--portal-ink);
  max-width: 68rem;
  font-size: 0.98rem;
  line-height: 1.72;
  overflow-wrap: break-word;
}

.guide-document .card-body {
  padding: 1.75rem;
}

.guide-content h2 {
  margin: 0 0 1.15rem;
  color: var(--portal-accent-deep);
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 800;
}

.guide-content h3 {
  margin: 2rem 0 0.85rem;
  color: var(--portal-ink);
  font-size: 1.24rem;
  line-height: 1.3;
  font-weight: 800;
  padding: 0.75rem 0 0.55rem;
  border-top: 1px solid rgba(7, 29, 54, 0.08);
  border-bottom: 1px solid rgba(7, 29, 54, 0.06);
}

.guide-content h4 {
  margin: 1.45rem 0 0.6rem;
  color: var(--portal-accent-deep);
  font-size: 1.06rem;
  line-height: 1.35;
  font-weight: 800;
}

.guide-content h5 {
  margin: 1.1rem 0 0.5rem;
  color: var(--portal-ink);
  font-size: 0.98rem;
  line-height: 1.35;
  font-weight: 800;
}

.guide-content p,
.guide-content li {
  color: var(--portal-ink);
}

.guide-content p {
  margin-bottom: 1rem;
}

.guide-content ul,
.guide-content ol {
  padding-left: 1.45rem;
  margin: 0 0 1.15rem;
}

.guide-content ol[start] {
  margin-top: -0.25rem;
}

.guide-content li {
  margin-bottom: 0.42rem;
  padding-left: 0.1rem;
}

.guide-content li::marker {
  color: var(--portal-accent);
  font-weight: 800;
}

.guide-content a {
  color: var(--portal-accent);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(22, 79, 134, 0.28);
}

.guide-content a:hover {
  color: var(--portal-accent-deep);
  border-bottom-color: currentColor;
}

.guide-content code {
  color: #0f4c5c;
  background: rgba(22, 79, 134, 0.1);
  border-radius: 0.35rem;
  padding: 0.1rem 0.32rem;
  font-size: 0.9em;
  white-space: normal;
}

.guide-code {
  margin: 1rem 0 1.2rem;
  padding: 1rem;
  border-radius: 0.8rem;
  background: #071d36;
  color: #f8fafc;
  overflow: auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.guide-code code {
  color: inherit;
  background: transparent;
  padding: 0;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre;
}

.guide-table-wrap {
  margin: 1rem 0 1.25rem;
  border: 1px solid rgba(7, 29, 54, 0.1);
  border-radius: 0.8rem;
  background: #071d36;
  box-shadow: 0 0.55rem 1.2rem rgba(7, 29, 54, 0.06);
}

.guide-table {
  margin-bottom: 0;
  min-width: 42rem;
}

.guide-table th {
  color: #fff;
  background: var(--portal-accent-deep);
  border: 0;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.guide-table td {
  color: var(--portal-ink);
  border-color: rgba(7, 29, 54, 0.08);
  vertical-align: top;
}

.guide-table tbody tr:nth-child(even) td {
  background: rgba(22, 79, 134, 0.035);
}

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

.guide-validation-card {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid rgba(7, 29, 54, 0.09);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 254, 0.95) 100%);
}

.guide-validation-icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 8px;
  color: #fff;
}

.guide-validation-icon-blue { background: #2563eb; }
.guide-validation-icon-teal { background: #164f86; }
.guide-validation-icon-amber { background: #7fb4ff; }
.guide-validation-icon-green { background: #7fb4ff; }
.guide-validation-icon-purple { background: #9fc7ff; }
.guide-validation-icon-red { background: #b91c1c; }

.guide-validation-card h4 {
  margin: 0;
  color: var(--portal-accent-deep);
  font-size: 1.02rem;
  font-weight: 800;
}

.guide-validation-card p {
  margin: 0;
  color: var(--portal-muted);
  line-height: 1.55;
}

.guide-validation-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--portal-ink);
  line-height: 1.5;
}

.guide-validation-card li {
  margin-bottom: 0.25rem;
}

.guide-validation-sample-button {
  justify-self: start;
  font-weight: 700;
}

.guide-validation-example {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(22, 79, 134, 0.06);
}

.guide-validation-example strong {
  color: var(--portal-accent-deep);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.guide-validation-example span {
  color: var(--portal-ink);
  line-height: 1.45;
}

.guide-validation-note {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  color: #f8fbff;
  background: #0d3560;
  border: 1px solid #bbf7d0;
}

.guide-validation-note i {
  margin-top: 0.2rem;
}

.guide-validation-note strong,
.guide-validation-note span {
  display: block;
}

.guide-validation-note span {
  color: #166534;
  line-height: 1.5;
}

.guide-validation-workflow h4,
.guide-validation-limitations h4,
.guide-validation-runpaths h4,
.guide-validation-source-profile h4 {
  margin: 0 0 0.7rem;
  color: var(--portal-accent-deep);
  font-size: 1.05rem;
  font-weight: 800;
}

.guide-validation-limitations {
  padding: 1rem;
  border: 1px solid rgba(7, 29, 54, 0.09);
  border-radius: 8px;
  background: rgba(248, 251, 254, 0.86);
}

.guide-validation-limitations p {
  margin: 0 0 0.9rem;
  color: var(--portal-muted);
  line-height: 1.55;
}

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

.guide-validation-runpath-grid article {
  padding: 1rem;
  border: 1px solid rgba(7, 29, 54, 0.09);
  border-radius: 8px;
  background: rgba(248, 251, 254, 0.86);
}

.guide-validation-runpath-grid h5 {
  margin: 0 0 0.5rem;
  color: var(--portal-accent-deep);
  font-size: 0.98rem;
  font-weight: 800;
}

.guide-validation-runpath-grid p,
.guide-validation-runpath-grid li {
  color: var(--portal-ink);
  line-height: 1.5;
}

.guide-validation-runpath-grid ul {
  margin: 0;
  padding-left: 1.1rem;
}

.guide-validation-source-profile {
  padding: 1rem;
  border: 1px solid rgba(22, 79, 134, 0.12);
  border-radius: 8px;
  background: rgba(22, 79, 134, 0.04);
}

.guide-validation-source-profile > p {
  margin: 0 0 0.9rem;
  color: var(--portal-muted);
  line-height: 1.55;
}

.validation-sample-modal .modal-body {
  background: rgba(248, 251, 254, 0.8);
}

.validation-sample-code {
  max-height: 58vh;
  margin-bottom: 0;
}

.validation-sample-code code {
  white-space: pre;
}

.guide-content blockquote {
  margin: 1rem 0 1.15rem;
  padding: 0.85rem 1rem;
  border-left: 0.25rem solid var(--portal-accent);
  border-radius: 0 0.7rem 0.7rem 0;
  color: var(--portal-muted);
  background: rgba(22, 79, 134, 0.06);
}

.guide-divider {
  margin: 1.6rem 0;
  border: 0;
  border-top: 1px solid rgba(7, 29, 54, 0.1);
}

@media (max-width: 575.98px) {
  .guide-document .card-body {
    padding: 1.1rem;
  }

  .guide-content {
    font-size: 0.95rem;
  }

  .guide-content h2 {
    font-size: 1.32rem;
  }

  .guide-content h3 {
    font-size: 1.12rem;
  }

  .guide-validation-grid {
    grid-template-columns: 1fr;
  }

  .guide-validation-runpath-grid {
    grid-template-columns: 1fr;
  }
}

.source-rules-summary {
  cursor: help;
  max-width: 18rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.55rem;
  background: rgba(22, 79, 134, 0.05);
}

.reconciliation-payload-card {
  display: grid;
  gap: 0.65rem;
  max-height: 26rem;
  overflow: auto;
  padding: 0.85rem;
  border: 1px solid rgba(7, 29, 54, 0.1);
  border-radius: 0.8rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,251,254,0.96) 100%);
}

.reconciliation-payload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-start;
  padding: 0.65rem;
  border: 1px solid rgba(22, 79, 134, 0.1);
  border-radius: 0.7rem;
  background: rgba(22, 79, 134, 0.04);
}

.reconciliation-payload-row span {
  display: inline-flex;
  max-width: 100%;
  padding: 0.28rem 0.5rem;
  border-radius: 0.5rem;
  color: var(--portal-ink);
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
  word-break: break-word;
}

.reconciliation-payload-row span.reconciliation-incoming-new {
  color: #7f1d1d;
  background: #fee2e2;
  border: 1px solid #fecaca;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.28);
  animation: reconciliationIncomingPulse 1.9s ease-in-out infinite;
}

.reconciliation-bulk-card {
  border-left: 4px solid var(--portal-accent);
}

.reconciliation-patient-tooltip {
  cursor: help;
  border-bottom: 1px dotted rgba(7, 29, 54, 0.36);
}

.reconciliation-session-detail-table,
.reconciliation-session-detail-table th,
.reconciliation-session-detail-table td {
  color: #f8fbff;
}

@keyframes reconciliationIncomingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.28);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 0 0.28rem rgba(239, 68, 68, 0);
    transform: translateY(-1px);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reconciliation-payload-row span.reconciliation-incoming-new {
    animation: none;
  }
}

.xml-textarea-search-target {
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre;
  overflow: auto;
}

.section-completeness-card {
  padding: 1rem;
  border: 1px solid rgba(7, 29, 54, 0.08);
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(244,249,252,0.94) 100%);
}

.section-completeness-card table,
.section-completeness-card th,
.section-completeness-card td,
.section-completeness-card code,
.section-completeness-card .fw-semibold {
  color: #f8fbff;
}

.section-completeness-card .text-muted {
  color: #f8fbff !important;
}

.section-completeness-score {
  min-width: 8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.85rem;
  background: rgba(22, 79, 134, 0.09);
  color: var(--portal-accent-deep);
  text-align: center;
  font-weight: 800;
}

.section-completeness-score span {
  display: block;
  font-size: 1.45rem;
  line-height: 1;
}

.section-completeness-score small {
  color: var(--portal-muted);
  font-weight: 700;
}

.printable-toolbar-card {
  border-radius: 1.25rem;
}

.printable-summary-card {
  border-radius: 1.25rem;
}

.printable-section-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.printable-section-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: rgba(22, 79, 134, 0.08);
  border: 1px solid rgba(22, 79, 134, 0.12);
  color: var(--portal-accent-deep);
  font-weight: 700;
}

.printable-section-chip code {
  color: #475569;
  font-weight: 600;
}

.printable-document-shell {
  max-width: 1100px;
  margin: 0 auto;
}

.ccda-print-document {
  background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(248,251,254,0.97) 100%);
  border: 1px solid rgba(7, 29, 54, 0.08);
  border-radius: 1.5rem;
  box-shadow: 0 24px 44px rgba(7, 29, 54, 0.10);
  overflow: hidden;
  max-width: 100%;
}

.ccda-print-header {
  padding: 1.6rem 1.7rem 1.2rem;
  background:
    radial-gradient(circle at top right, rgba(22, 79, 134, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(243,248,252,0.94) 100%);
  border-bottom: 1px solid rgba(7, 29, 54, 0.08);
}

.ccda-print-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.ccda-print-kicker {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #6b7f92;
  font-weight: 800;
  margin-bottom: 0.45rem;
}

.ccda-print-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--portal-accent-deep);
}

.ccda-print-subtitle {
  color: var(--portal-muted);
  font-size: 1rem;
}

.ccda-print-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(22, 79, 134, 0.10);
  color: var(--portal-accent-deep);
  font-weight: 700;
  border: 1px solid rgba(22, 79, 134, 0.16);
}

.ccda-print-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}

.ccda-print-meta-card {
  padding: 1rem 1.05rem;
  border-radius: 1.1rem;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(7, 29, 54, 0.08);
}

.ccda-print-meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #6b7f92;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.ccda-print-meta-value {
  font-weight: 700;
  color: var(--portal-ink);
  margin-bottom: 0.25rem;
  overflow-wrap: anywhere;
}

.ccda-print-meta-note {
  color: var(--portal-muted);
  line-height: 1.4;
}

.ccda-print-body {
  padding: 1.35rem;
  max-width: 100%;
  overflow-x: auto;
}

@media print {
  .app-header,
  .app-sidebar,
  .app-content-header,
  .printable-toolbar-card {
    display: none !important;
  }

  .app-main,
  .app-header {
    margin-left: 0 !important;
  }

  body {
    background: #071d36 !important;
  }

  .app-content .container-fluid {
    padding: 0 !important;
  }

  .ccda-print-document {
    box-shadow: none;
    border: 0;
  }
}

.portal-header {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.96) 0%, rgba(244,248,255,0.92) 48%, rgba(204,220,240,0.9) 100%) !important;
  border-bottom: 1px solid rgba(7, 29, 54, 0.18);
  box-shadow: 0 8px 24px rgba(7, 29, 54, 0.08);
}

.portal-content-header {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(243,248,255,0.96) 58%, rgba(221,233,247,0.94) 100%) !important;
  border-bottom-color: rgba(7, 29, 54, 0.12) !important;
}

.avatar-button {
  width: 42px;
  height: 42px;
  font-weight: 700;
  color: var(--portal-accent-deep);
  border: 1px solid rgba(7, 29, 54, 0.08);
}

.portal-logout-button {
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 600;
  border-color: rgba(7, 29, 54, 0.14);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(8px);
}

.portal-logout-button:hover {
  background: rgba(7, 29, 54, 0.06);
  border-color: rgba(7, 29, 54, 0.22);
}

.portal-workflow-button {
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-weight: 700;
  border-color: rgba(22, 79, 134, 0.24);
  background: rgba(22, 79, 134, 0.1);
}

.portal-workflow-button:hover {
  background: rgba(22, 79, 134, 0.16);
  border-color: rgba(22, 79, 134, 0.34);
}

.portal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.portal-toolbar .form-control,
.portal-toolbar .form-select {
  min-width: 180px;
}

.portal-toast-host {
  z-index: 2000;
}

.portal-toast {
  min-width: 320px;
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(7, 29, 54, 0.14);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.action-cell {
  min-width: 180px;
}

.dataTables_filter {
  display: none;
}

.required-label::after {
  content: " *";
  color: #dc3545;
}

.role-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.role-chip {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(7, 29, 54, 0.08);
}

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 16%, rgba(22, 79, 134, 0.2), transparent 26%),
    linear-gradient(120deg, #ffffff 0%, #f5f9ff 48%, #dce8f5 100%);
  color: var(--portal-ink);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
}

.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 5rem;
  display: grid;
  align-content: center;
  gap: 2rem;
  text-align: left;
  color: #071d36;
  background:
    linear-gradient(135deg, rgba(232, 245, 243, 0.92) 0%, rgba(13, 53, 96, 0.86) 48%, rgba(254, 243, 199, 0.76) 100%),
    url("data:image/svg+xml,%3Csvg width='900' height='640' viewBox='0 0 900 640' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.2)' stroke-width='1'%3E%3Cpath d='M90 96h720M90 192h720M90 288h720M90 384h720M90 480h720M180 40v560M360 40v560M540 40v560M720 40v560'/%3E%3C/g%3E%3Cg fill='rgba(255,255,255,0.18)'%3E%3Crect x='132' y='116' width='148' height='58' rx='8'/%3E%3Crect x='414' y='212' width='210' height='58' rx='8'/%3E%3Crect x='256' y='348' width='174' height='58' rx='8'/%3E%3Crect x='586' y='452' width='162' height='58' rx='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  backdrop-filter: blur(18px);
}

.auth-hero h1 {
  font-size: clamp(2rem, 3vw, 3.35rem);
  line-height: 1.08;
  margin-bottom: 1rem;
  max-width: 14ch;
  text-wrap: balance;
  color: #16445b;
}

.auth-hero p {
  max-width: 48ch;
  color: rgba(15, 47, 69, 0.72);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 0;
}

.auth-kicker {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
  color: rgba(15, 47, 69, 0.58);
  margin-bottom: 1rem;
}

.auth-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.auth-badges .badge {
  padding: 0.58rem 0.8rem;
  color: #071d36 !important;
  background: rgba(255,255,255,0.88) !important;
}

.auth-hero-panel {
  width: min(100%, 560px);
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.58);
  border-radius: 8px;
  background: rgba(255,255,255,0.44);
  box-shadow: 0 24px 70px rgba(15, 47, 69, 0.08);
  backdrop-filter: blur(18px);
}

.auth-hero-panel-header,
.auth-hero-status {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 0.9rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.42);
}

.auth-hero-panel-header > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255,255,255,0.58);
}

.auth-hero-panel strong,
.auth-hero-panel small {
  display: block;
}

.auth-hero-panel small {
  color: rgba(15, 47, 69, 0.56);
  font-size: 0.78rem;
}

.auth-hero-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.85rem 0;
}

.auth-hero-flow div {
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  padding: 0.85rem 0.45rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.94);
  color: #071d36;
  font-size: 0.78rem;
  font-weight: 800;
}

.auth-hero-flow i {
  color: #6ea8fe;
  font-size: 1rem;
}

.auth-hero-status span {
  width: 0.75rem;
  height: 0.75rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #86efac;
  box-shadow: 0 0 0 6px rgba(134,239,172,0.15);
}

.auth-card-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
}

.auth-card {
  width: min(100%, 460px);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(240,249,255,0.96) 100%);
  color: var(--portal-ink);
  box-shadow: 0 24px 52px rgba(15, 47, 69, 0.14) !important;
}

.auth-card h2 {
  font-size: 1.55rem;
}

.auth-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--portal-accent-soft);
  color: var(--portal-accent-deep);
  font-size: 1.2rem;
}

.auth-demo-note {
  border-radius: 8px;
  background: rgba(22, 79, 134, 0.08);
  padding: 0.85rem 1rem;
  color: var(--portal-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.auth-demo-note .fw-semibold {
  color: var(--portal-accent-deep);
  font-size: 0.9rem;
}

.auth-card .form-label {
  font-size: 0.9rem;
}

.auth-card .form-control-lg,
.auth-card .btn-lg {
  min-height: 48px;
  font-size: 0.98rem;
}

.workflow-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(22, 79, 134, 0.2), transparent 20%),
    radial-gradient(circle at 88% 20%, rgba(7, 29, 54, 0.18), transparent 24%),
    radial-gradient(circle at 75% 85%, rgba(59, 130, 246, 0.12), transparent 22%),
    linear-gradient(135deg, rgba(255,255,255,0.99) 0%, rgba(246,250,255,0.97) 48%, rgba(220,232,245,0.95) 100%);
  box-shadow: 0 24px 44px rgba(7, 29, 54, 0.14);
}

.workflow-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.18) 0%, transparent 36%),
    linear-gradient(180deg, rgba(7, 29, 54, 0.02), transparent 40%);
  pointer-events: none;
}

.workflow-hero-copy {
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.workflow-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.workflow-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.55rem 0.92rem;
  background: rgba(255,255,255,0.74);
  color: var(--portal-accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(22, 79, 134, 0.12);
  box-shadow: 0 10px 22px rgba(7, 29, 54, 0.08);
}

.workflow-page-shell {
  position: relative;
}

.workflow-highlight-card {
  border-radius: 1.25rem;
  padding: 1rem 1.1rem;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92) 0%, rgba(247,251,255,0.96) 100%);
  border: 1px solid rgba(7, 29, 54, 0.08);
  box-shadow: 0 14px 28px rgba(7, 29, 54, 0.08);
}

.workflow-highlight-strip .col-md-4:nth-child(1) .workflow-highlight-card {
  border-top: 4px solid #6ea8fe;
}

.workflow-highlight-strip .col-md-4:nth-child(2) .workflow-highlight-card {
  border-top: 4px solid #2563eb;
}

.workflow-highlight-strip .col-md-4:nth-child(3) .workflow-highlight-card {
  border-top: 4px solid #9fc7ff;
}

.workflow-highlight-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #6b7f92;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.workflow-highlight-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--portal-ink);
}

.workflow-group-block {
  position: relative;
}

.workflow-group-header {
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(7, 29, 54, 0.08);
}

.workflow-group-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.96) 0%, rgba(237,247,252,0.94) 100%);
  border: 1px solid rgba(7, 29, 54, 0.08);
  color: var(--portal-accent-deep);
  box-shadow: 0 14px 24px rgba(7, 29, 54, 0.08);
  flex: 0 0 auto;
}

.workflow-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.45rem;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 20px 36px rgba(7, 29, 54, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: workflowCardIn 0.55s ease both;
}

.workflow-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, #2563eb 0%, #164f86 100%);
}

.workflow-card[data-workflow-group="1"]::before {
  background: linear-gradient(90deg, #6ea8fe 0%, #b8d7ff 100%);
}

.workflow-card[data-workflow-group="2"]::before {
  background: linear-gradient(90deg, #2563eb 0%, #164f86 100%);
}

.workflow-card[data-workflow-group="3"]::before {
  background: linear-gradient(90deg, #8b5cf6 0%, #ec4899 100%);
}

.workflow-group-block:nth-of-type(1) .workflow-card { animation-delay: 0.04s; }
.workflow-group-block:nth-of-type(1) .workflow-card:nth-child(2) { animation-delay: 0.09s; }
.workflow-group-block:nth-of-type(2) .workflow-card { animation-delay: 0.12s; }
.workflow-group-block:nth-of-type(2) .workflow-card:nth-child(2) { animation-delay: 0.17s; }
.workflow-group-block:nth-of-type(3) .workflow-card { animation-delay: 0.2s; }
.workflow-group-block:nth-of-type(3) .workflow-card:nth-child(2) { animation-delay: 0.25s; }

.workflow-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 48px rgba(7, 29, 54, 0.14);
}

.workflow-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(7, 29, 54, 0.98) 0%, rgba(22, 79, 134, 0.94) 100%);
  color: #fff;
  box-shadow: 0 18px 34px rgba(7, 29, 54, 0.18);
  flex: 0 0 auto;
}

.workflow-card[data-workflow-group="1"] .workflow-card-icon {
  background: linear-gradient(135deg, #b8d7ff 0%, #6ea8fe 100%);
  box-shadow: 0 18px 34px rgba(110, 168, 254, 0.28);
}

.workflow-card[data-workflow-group="2"] .workflow-card-icon {
  background: linear-gradient(135deg, #d8e9ff 0%, #06b6d4 100%);
  box-shadow: 0 18px 34px rgba(139, 188, 255, 0.24);
}

.workflow-card[data-workflow-group="3"] .workflow-card-icon {
  background: linear-gradient(135deg, #d8e9ff 0%, #db2777 100%);
  box-shadow: 0 18px 34px rgba(159, 199, 255, 0.24);
}

.workflow-track {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  position: relative;
}

.workflow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 2.25rem;
  width: 2px;
  height: calc(100% + 0.25rem);
  background: linear-gradient(180deg, rgba(22, 79, 134, 0.22) 0%, rgba(22, 79, 134, 0.04) 100%);
}

.workflow-card[data-workflow-group="1"] .workflow-step:not(:last-child)::after {
  background: linear-gradient(180deg, rgba(110, 168, 254, 0.34) 0%, rgba(110, 168, 254, 0.04) 100%);
}

.workflow-card[data-workflow-group="2"] .workflow-step:not(:last-child)::after {
  background: linear-gradient(180deg, rgba(139, 188, 255, 0.34) 0%, rgba(139, 188, 255, 0.04) 100%);
}

.workflow-card[data-workflow-group="3"] .workflow-step:not(:last-child)::after {
  background: linear-gradient(180deg, rgba(159, 199, 255, 0.34) 0%, rgba(159, 199, 255, 0.04) 100%);
}

.workflow-step-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(22, 79, 134, 0.12);
  color: var(--portal-accent-deep);
  font-weight: 800;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 1px rgba(22, 79, 134, 0.08);
}

.workflow-card[data-workflow-group="1"] .workflow-step-marker {
  background: rgba(110, 168, 254, 0.16);
  color: #b8d7ff;
}

.workflow-card[data-workflow-group="2"] .workflow-step-marker {
  background: rgba(139, 188, 255, 0.16);
  color: #d8e9ff;
}

.workflow-card[data-workflow-group="3"] .workflow-step-marker {
  background: rgba(159, 199, 255, 0.16);
  color: #d8e9ff;
}

.workflow-step-body {
  padding-top: 0.35rem;
  flex: 1 1 auto;
}

.workflow-step-text {
  line-height: 1.45;
  color: var(--portal-ink);
}

.workflow-card-footer {
  border-color: rgba(7, 29, 54, 0.08) !important;
}

.workflow-launch-button {
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-weight: 700;
  background: rgba(255,255,255,0.9);
}

.workflow-card[data-workflow-group="1"] .workflow-launch-button {
  color: #b8d7ff;
  border-color: rgba(110, 168, 254, 0.28);
  background: rgba(13, 53, 96, 0.6);
}

.workflow-card[data-workflow-group="1"] .workflow-launch-button:hover {
  color: #f8fbff;
  border-color: rgba(110, 168, 254, 0.42);
  background: rgba(13, 53, 96, 0.92);
}

.workflow-card[data-workflow-group="2"] .workflow-launch-button {
  color: #d8e9ff;
  border-color: rgba(139, 188, 255, 0.28);
  background: rgba(13, 53, 96, 0.76);
}

.workflow-card[data-workflow-group="2"] .workflow-launch-button:hover {
  color: #8bbcff;
  border-color: rgba(139, 188, 255, 0.42);
  background: rgba(13, 53, 96, 0.96);
}

.workflow-card[data-workflow-group="3"] .workflow-launch-button {
  color: #d8e9ff;
  border-color: rgba(159, 199, 255, 0.28);
  background: rgba(13, 53, 96, 0.8);
}

.workflow-card[data-workflow-group="3"] .workflow-launch-button:hover {
  color: #f8fbff;
  border-color: rgba(159, 199, 255, 0.42);
  background: rgba(13, 53, 96, 0.98);
}

@keyframes workflowCardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.workflow-dashboard-card {
  background:
    linear-gradient(90deg, rgba(7, 29, 54, 0.95) 0%, rgba(22, 79, 134, 0.9) 100%);
  color: #f5f9ff;
}

.workflow-dashboard-card .text-muted {
  color: rgba(248,251,255,0.78) !important;
}

.workflow-dashboard-button {
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.18);
  font-weight: 700;
}

.workflow-dashboard-button:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border-color: rgba(255,255,255,0.28);
}

.patient-corrections-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: stretch;
  padding: 2rem;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #071d36 0%, #6ea8fe 54%, #7fb4ff 100%);
  color: #fff;
  box-shadow: 0 18px 42px rgba(15, 47, 69, 0.18);
}

.patient-corrections-hero h2 {
  max-width: 760px;
  margin: 0.25rem 0 0.75rem;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.08;
}

.patient-corrections-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255,255,255,0.86);
}

.patient-corrections-hero-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  gap: 0.75rem;
}

.patient-corrections-stat {
  min-width: 118px;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  background: rgba(255,255,255,0.13);
}

.patient-corrections-stat span {
  display: block;
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
}

.patient-corrections-stat small {
  display: block;
  margin-top: 0.4rem;
  color: rgba(255,255,255,0.82);
}

.patient-correction-card {
  border-radius: 8px;
}

.patient-correction-list,
.patient-audit-session-list {
  display: grid;
  gap: 0.75rem;
  max-height: 840px;
  overflow: auto;
}

.patient-correction-patient {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem;
  color: var(--portal-ink);
  text-decoration: none;
  border: 1px solid rgba(15, 47, 69, 0.12);
  border-left: 4px solid transparent;
  border-radius: 8px;
  background: #071d36;
}

.patient-correction-patient span:not(.fw-semibold) {
  color: var(--portal-muted);
  font-size: 0.86rem;
}

.patient-correction-patient:hover,
.patient-correction-patient.active {
  border-left-color: #6ea8fe;
  background: #0d3560;
  color: #f8fbff;
}

.patient-field-warning {
  display: flex;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 8px;
  background: #0d3560;
  border: 1px solid #8bbcff;
  color: #f8fbff;
}

.patient-field-warning i {
  margin-top: 0.2rem;
  color: #8bbcff;
}

.patient-field-warning span {
  display: block;
  color: #b8d7ff;
}

.patient-correction-section,
.patient-correction-attestation {
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(15, 47, 69, 0.1);
  border-radius: 8px;
  background: #071d36;
}

.patient-correction-section h4,
.patient-correction-attestation h4 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--portal-accent-deep);
}

.patient-correction-form .form-control,
.patient-correction-form .form-select {
  color: #f8fbff;
}

.patient-corrections-loading {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.field-intimation {
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7fb4ff;
}

.patient-correction-attestation {
  background: #071d36;
  border-color: #cbd5e1;
}

.patient-audit-auto {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: #0d3560;
  color: #f8fbff;
  font-size: 0.86rem;
  font-weight: 700;
}

.patient-audit-auto i {
  color: #6ea8fe;
}

.patient-audit-session {
  padding: 1rem;
  border: 1px solid rgba(15, 47, 69, 0.12);
  border-radius: 8px;
  background: #071d36;
}

.patient-audit-session p {
  margin: 0.65rem 0;
  color: var(--portal-ink);
}

.patient-audit-change {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem 0;
  border-top: 1px solid rgba(15, 47, 69, 0.08);
}

.patient-audit-change span {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--portal-accent-deep);
  text-transform: uppercase;
}

.patient-audit-change small {
  color: var(--portal-muted);
  overflow-wrap: anywhere;
}

.patient-audit-change del,
.patient-audit-change ins {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.patient-audit-change del {
  color: #7f1d1d;
  background: #fef2f2;
}

.patient-audit-change ins {
  color: #f8fbff;
  background: #0d3560;
}

.patient-audit-empty-search {
  padding: 0.85rem;
  border-radius: 8px;
  color: var(--portal-muted);
  background: #071d36;
  border: 1px dashed #cbd5e1;
  font-size: 0.9rem;
}

.patient-correction-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  color: #6ea8fe;
  background: #ccfbf1;
}

.patient-clinical-accordion .accordion-item {
  border-color: rgba(15, 47, 69, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.patient-clinical-accordion .accordion-item + .accordion-item {
  margin-top: 0.75rem;
}

.patient-clinical-accordion .accordion-button {
  color: var(--portal-accent-deep);
  font-weight: 800;
  background: #071d36;
}

.patient-clinical-records {
  display: grid;
  gap: 1rem;
}

.patient-clinical-record {
  padding: 1rem;
  border: 1px solid rgba(15, 47, 69, 0.12);
  border-left: 4px solid #6ea8fe;
  border-radius: 8px;
  background: #071d36;
}

.patient-clinical-record h5 {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  color: var(--portal-ink);
}

.patient-clinical-record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.patient-clinical-edit-button {
  min-width: 9.5rem;
  color: #fff !important;
  font-weight: 800;
}

.patient-clinical-current-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.patient-clinical-current-values div {
  padding: 0.75rem;
  border-radius: 8px;
  background: #071d36;
  border: 1px solid #e2e8f0;
}

.patient-clinical-current-values span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--portal-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.patient-clinical-current-values strong {
  display: block;
  color: #f8fbff;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.patient-clinical-editor {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.patient-clinical-record.is-dirty {
  border-left-color: #2563eb;
  background: #f5f9ff;
}

.patient-clinical-savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.patient-clinical-dirty-indicator {
  color: var(--portal-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.patient-clinical-record.is-dirty .patient-clinical-dirty-indicator {
  color: #1d4ed8;
}

.patient-clinical-empty {
  padding: 1rem;
  border-radius: 8px;
  color: var(--portal-muted);
  background: #071d36;
  border: 1px dashed #cbd5e1;
}

.permission-category-badge {
  color: #f8fbff !important;
}

.import-xml-preview-panel {
  border: 1px solid rgba(166, 200, 241, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(4, 19, 38, 0.98) 0%, rgba(7, 29, 54, 0.96) 100%);
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.import-xml-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(166, 200, 241, 0.18);
  background:
    linear-gradient(90deg, rgba(7, 29, 54, 0.98) 0%, rgba(13, 53, 96, 0.95) 54%, rgba(22, 79, 134, 0.88) 100%);
  color: #f8fbff;
}

.import-xml-preview-header .badge,
.import-xml-preview-header .btn {
  color: #f8fbff !important;
}

.import-xml-preview-panel .xml-search-toolbar {
  padding: 0 1rem;
}

.import-xml-preview {
  margin: 0;
  max-height: 520px;
  overflow: auto;
  padding: 1.1rem 1.1rem 1.1rem 1.35rem;
  border-top: 1px solid rgba(166, 200, 241, 0.16);
  border-left: 5px solid #6ea8fe;
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(180deg, #020817 0%, #071527 100%);
  background-size: 100% 1.55rem, 2.5rem 100%, 100% 100%;
  color: #eaf3ff;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.import-xml-preview code {
  color: inherit;
}

.import-mu3-printable {
  max-height: 720px;
  overflow: auto;
  padding: 1rem;
  border-top: 1px solid rgba(166, 200, 241, 0.16);
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.08), transparent 24%),
    linear-gradient(180deg, #020817 0%, #071527 100%);
}

.import-mu3-printable .ccda-print-document,
.import-mu3-printable .ccda-print-document *,
.import-mu3-printable .ccda-narrative,
.import-mu3-printable .ccda-narrative * {
  color: #111827 !important;
}

.import-mu3-printable .ccda-print-document {
  max-width: 980px;
  margin: 0 auto;
  background: #ffffff !important;
  border: 1px solid #d7dee8 !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
}

.import-mu3-printable .ccda-print-header {
  background: linear-gradient(180deg, #f8fbff 0%, #e8f0fb 100%) !important;
  border-bottom: 1px solid #d7dee8 !important;
}

.import-mu3-printable .ccda-print-badge {
  background: #0d3560 !important;
  color: #ffffff !important;
}

.import-mu3-printable .ccda-print-meta-card,
.import-mu3-printable .ccda-section,
.import-mu3-printable .ccda-empty-state {
  background: #ffffff !important;
  border-color: #d7dee8 !important;
}

.import-mu3-printable table,
.import-mu3-printable th,
.import-mu3-printable td {
  color: #111827 !important;
  background: #ffffff !important;
  border-color: #d7dee8 !important;
}

.import-conversion-review {
  padding: 1rem;
  border: 1px solid rgba(7, 29, 54, 0.12);
  border-radius: 8px;
  background: #071d36;
}

.import-conversion-empty-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px dashed rgba(7, 29, 54, 0.22);
  border-radius: 8px;
  background: #071d36;
}

.import-clinical-summary,
.import-validation-panel {
  height: 100%;
  padding: 0.9rem;
  border: 1px solid rgba(7, 29, 54, 0.1);
  border-radius: 8px;
  background: #071d36;
}

.import-clinical-summary dd {
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
}

.import-summary-sections,
.import-validation-list {
  display: grid;
  gap: 0.65rem;
}

.import-summary-section,
.import-validation-item {
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #64748b;
  border-radius: 8px;
  background: #071d36;
}

.import-summary-section ul {
  padding-left: 1rem;
}

.import-validation-item.is-blocking {
  border-left-color: #dc2626;
  background: #0d3560;
}

.import-validation-item.is-warning {
  border-left-color: #d97706;
  background: #0d3560;
}

.import-validation-item.is-info {
  border-left-color: #0284c7;
  background: #f0f9ff;
}

.import-validation-item code {
  display: block;
  margin-top: 0.25rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.import-guidance-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
}

.import-guidance-toolbar .form-control {
  max-width: 320px;
}

.import-validation-guidance {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid rgba(166, 200, 241, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(2, 8, 23, 0.92) 0%, rgba(7, 21, 39, 0.9) 100%);
  color: #f8fbff !important;
  font-size: 0.83rem;
  line-height: 1.45;
}

.import-validation-guidance *,
.import-validation-item,
.import-validation-item * {
  color: #f8fbff !important;
}

.import-side-preview {
  height: 100%;
  padding: 0.9rem;
  border: 1px solid rgba(7, 29, 54, 0.1);
  border-radius: 8px;
  background: #071d36;
}

.import-source-preview {
  min-height: 220px;
  max-height: 360px;
  margin: 0;
  overflow: auto;
  padding: 0.8rem;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.import-source-preview code {
  color: inherit;
}

.guide-error-search {
  position: sticky;
  top: 0.75rem;
  z-index: 2;
  padding: 0.75rem;
  border: 1px solid rgba(7, 29, 54, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.guide-error-table td {
  vertical-align: top;
}

.guide-error-table td:first-child {
  min-width: 9rem;
  font-weight: 700;
  color: var(--portal-accent-deep);
}

.guide-error-table code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.btn-primary,
.text-bg-primary,
.bg-primary {
  background: linear-gradient(135deg, var(--portal-navy) 0%, var(--portal-navy-mid) 54%, var(--portal-accent) 100%) !important;
  border-color: var(--portal-navy-mid) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #041326 0%, var(--portal-navy) 48%, var(--portal-navy-light) 100%) !important;
  border-color: var(--portal-navy) !important;
  color: #fff !important;
}

.btn-outline-primary {
  border-color: rgba(22, 79, 134, 0.48) !important;
  color: var(--portal-navy-mid) !important;
}

.btn-outline-primary:hover,
.btn-check:checked + .btn-outline-primary {
  background: linear-gradient(135deg, var(--portal-navy) 0%, var(--portal-accent) 100%) !important;
  border-color: var(--portal-navy-mid) !important;
  color: #fff !important;
}

.bg-primary-subtle,
.alert-primary {
  background: linear-gradient(135deg, rgba(255,255,255,0.96) 0%, rgba(226,236,249,0.94) 100%) !important;
  color: var(--portal-navy) !important;
  border-color: rgba(22, 79, 134, 0.18) !important;
}

.text-primary {
  color: var(--portal-navy-mid) !important;
}

.border-primary {
  border-color: rgba(22, 79, 134, 0.34) !important;
}

.card,
.modal-content,
.dropdown-menu,
.offcanvas {
  background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(248,251,255,0.97) 100%);
  border-color: rgba(7, 29, 54, 0.1);
  box-shadow: 0 16px 32px rgba(7, 29, 54, 0.07);
}

.table thead,
.card-header,
.modal-header {
  background: linear-gradient(90deg, rgba(255,255,255,0.98) 0%, rgba(232,240,251,0.94) 100%);
  color: var(--portal-navy);
  border-color: rgba(7, 29, 54, 0.1);
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--portal-navy) 0%, var(--portal-accent) 100%) !important;
  border-color: var(--portal-navy-mid) !important;
  color: #fff !important;
}

.nav-tabs .nav-link,
.nav-pills .nav-link {
  color: #d6e6f8 !important;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(166, 200, 241, 0.18);
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus,
.nav-pills .nav-link:hover,
.nav-pills .nav-link:focus {
  color: #ffffff !important;
  border-color: rgba(184, 215, 255, 0.44);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(22, 79, 134, 0.48);
  box-shadow: 0 0 0 0.2rem rgba(22, 79, 134, 0.14);
}

/* Contrast safety layer: keep text readable after theme overrides and Bootstrap utilities. */
body,
.app-main,
.app-content,
.card,
.card-body,
.modal-content,
.dropdown-menu,
.offcanvas,
.table,
.form-control,
.form-select,
.list-group-item,
.tab-content,
.accordion-item {
  color: var(--portal-ink);
}

.text-muted,
.small.text-muted,
.form-text,
.table .text-muted,
.card .text-muted,
.modal-content .text-muted,
.dropdown-menu .text-muted,
.app-content .text-muted,
.app-content-header .text-muted,
.portal-header .text-muted {
  color: #344965 !important;
}

.card-header,
.card-header *,
.modal-header,
.modal-header *,
.table thead,
.table thead *,
.portal-content-header,
.portal-content-header *,
.bg-white,
.bg-white *,
.bg-primary-subtle,
.bg-primary-subtle *,
.alert-primary,
.alert-primary * {
  color: var(--portal-ink);
}

.portal-header,
.portal-header *,
.dashboard-hero,
.dashboard-hero *,
.workflow-hero,
.workflow-hero * {
  color: var(--portal-ink);
}

.app-sidebar,
.app-sidebar *,
.guide-purpose-card,
.guide-purpose-card *,
.guide-flows-intro,
.guide-flows-intro *,
.auth-hero,
.auth-hero *,
.patient-corrections-hero,
.patient-corrections-hero *,
.bg-dark,
.bg-dark *,
.text-bg-dark,
.text-bg-dark *,
.import-source-preview,
.import-source-preview *,
.guide-code,
.guide-code *,
.xml-preview.bg-dark,
.xml-preview.bg-dark * {
  color: #f8fbff !important;
}

.app-sidebar .text-muted,
.guide-purpose-card .text-muted,
.guide-flows-intro .text-muted,
.auth-hero .text-muted,
.patient-corrections-hero .text-muted {
  color: #d6e6f8 !important;
}

.btn-primary,
.btn-primary *,
.text-bg-primary,
.text-bg-primary *,
.bg-primary,
.bg-primary *,
.text-bg-danger,
.text-bg-danger *,
.text-bg-success,
.text-bg-success *,
.text-bg-secondary,
.text-bg-secondary *,
.text-bg-dark,
.text-bg-dark *,
.badge.bg-primary,
.badge.bg-danger,
.badge.bg-success,
.badge.bg-secondary,
.badge.bg-dark {
  color: #fff !important;
}

.text-bg-warning,
.text-bg-warning *,
.text-bg-info,
.text-bg-info *,
.text-bg-light,
.text-bg-light *,
.alert-warning,
.alert-warning *,
.alert-info,
.alert-info *,
.alert-light,
.alert-light * {
  color: #071527 !important;
}

.alert-danger,
.alert-danger *,
.alert-success,
.alert-success * {
  color: #071527 !important;
}

.btn-outline-secondary,
.btn-outline-secondary *,
.btn-outline-primary,
.btn-outline-primary *,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info {
  color: var(--portal-navy-mid) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:hover *,
.btn-outline-primary:hover,
.btn-outline-primary:hover *,
.btn-outline-danger:hover,
.btn-outline-danger:hover *,
.btn-outline-warning:hover,
.btn-outline-warning:hover *,
.btn-outline-info:hover,
.btn-outline-info:hover *,
.btn-check:checked + .btn-outline-primary,
.btn-check:checked + .btn-outline-primary * {
  color: #fff !important;
}

.btn-outline-warning:hover,
.btn-outline-warning:hover *,
.btn-outline-info:hover,
.btn-outline-info:hover * {
  color: #071527 !important;
}

.form-control::placeholder,
.form-select::placeholder,
textarea::placeholder,
input::placeholder {
  color: #52677f !important;
  opacity: 1;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.alert-link) {
  color: #0d3560;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.alert-link):hover {
  color: #071d36;
}

/* Complete dark theme layer. This intentionally wins over legacy page and Bootstrap utility colors. */
body,
.app-main,
.app-content,
.auth-body {
  color: #f8fbff !important;
  background:
    radial-gradient(circle at top right, rgba(54, 111, 177, 0.28), transparent 28%),
    radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #031226 0%, #071d36 46%, #020817 100%) !important;
}

.card,
.modal-content,
.dropdown-menu,
.offcanvas,
.list-group-item,
.accordion-item,
.tab-content,
.import-conversion-review,
.import-conversion-empty-state,
.import-clinical-summary,
.import-validation-panel,
.import-side-preview,
.guide-validation-card,
.guide-flow-card,
.workflow-card,
.workflow-highlight-card,
.patient-correction-card,
.patient-correction-section,
.patient-correction-attestation,
.patient-audit-session,
.patient-correction-patient,
.role-chip,
.searchable-select,
.guide-error-search {
  background:
    linear-gradient(180deg, rgba(7, 29, 54, 0.98) 0%, rgba(4, 19, 38, 0.96) 100%) !important;
  border-color: rgba(166, 200, 241, 0.16) !important;
  color: #f8fbff !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.auth-card,
.auth-hero-panel,
.auth-demo-note,
.auth-hero-flow div {
  background:
    linear-gradient(180deg, rgba(7, 29, 54, 0.98) 0%, rgba(4, 19, 38, 0.96) 100%) !important;
  border-color: rgba(166, 200, 241, 0.16) !important;
  color: #f8fbff !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.card *,
.modal-content *,
.dropdown-menu *,
.offcanvas *,
.list-group-item *,
.accordion-item *,
.tab-content *,
.import-conversion-review *,
.import-conversion-empty-state *,
.import-clinical-summary *,
.import-validation-panel *,
.import-side-preview *,
.guide-validation-card *,
.guide-flow-card *,
.workflow-card *,
.workflow-highlight-card *,
.patient-correction-card *,
.patient-correction-section *,
.patient-correction-attestation *,
.patient-audit-session *,
.patient-correction-patient *,
.role-chip *,
.guide-error-search * {
  color: inherit;
}

.auth-card *,
.auth-hero-panel *,
.auth-demo-note *,
.auth-hero-flow div * {
  color: inherit;
}

.card-header,
.card-footer,
.modal-header,
.modal-footer,
.table thead,
.portal-content-header,
.settings-section-header,
.dashboard-panel-header {
  background:
    linear-gradient(90deg, rgba(13, 53, 96, 0.98) 0%, rgba(22, 79, 134, 0.92) 100%) !important;
  border-color: rgba(166, 200, 241, 0.18) !important;
  color: #f8fbff !important;
}

.card-header *,
.card-footer *,
.modal-header *,
.modal-footer *,
.table thead *,
.portal-content-header *,
.settings-section-header *,
.dashboard-panel-header * {
  color: #f8fbff !important;
}

.portal-header {
  background:
    linear-gradient(90deg, rgba(4, 19, 38, 0.98) 0%, rgba(7, 29, 54, 0.96) 54%, rgba(13, 53, 96, 0.94) 100%) !important;
  border-color: rgba(166, 200, 241, 0.16) !important;
}

.portal-header,
.portal-header * {
  color: #f8fbff !important;
}

.table,
.table > :not(caption) > * > * {
  background-color: rgba(4, 19, 38, 0.72) !important;
  color: #f8fbff !important;
  border-color: rgba(166, 200, 241, 0.14) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(22, 79, 134, 0.18) !important;
  color: #f8fbff !important;
}

.form-control,
.form-select,
.searchable-select-input,
textarea,
input:not([type="checkbox"]):not([type="radio"]) {
  background-color: rgba(2, 8, 23, 0.72) !important;
  border-color: rgba(166, 200, 241, 0.22) !important;
  color: #f8fbff !important;
}

.form-control:focus,
.form-select:focus,
.searchable-select-input:focus,
textarea:focus,
input:not([type="checkbox"]):not([type="radio"]):focus {
  background-color: rgba(2, 8, 23, 0.86) !important;
  border-color: #6ea8fe !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 0.2rem rgba(110, 168, 254, 0.24) !important;
}

.text-muted,
.small.text-muted,
.form-text,
.table .text-muted,
.card .text-muted,
.modal-content .text-muted,
.dropdown-menu .text-muted,
.app-content .text-muted,
.app-content-header .text-muted,
.portal-header .text-muted {
  color: #c8daf0 !important;
}

.bg-white,
.bg-light,
.bg-body-tertiary,
.bg-primary-subtle {
  background:
    linear-gradient(135deg, rgba(7, 29, 54, 0.98) 0%, rgba(13, 53, 96, 0.94) 100%) !important;
  color: #f8fbff !important;
}

.bg-white *,
.bg-light *,
.bg-body-tertiary *,
.bg-primary-subtle * {
  color: #f8fbff !important;
}

.text-dark,
.text-black {
  color: #f8fbff !important;
}

.btn-light,
.btn-outline-secondary,
.btn-outline-primary {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(166, 200, 241, 0.28) !important;
  color: #f8fbff !important;
}

.btn-light:hover,
.btn-outline-secondary:hover,
.btn-outline-primary:hover {
  background: linear-gradient(135deg, rgba(13, 53, 96, 0.98) 0%, rgba(22, 79, 134, 0.94) 100%) !important;
  border-color: #8bbcff !important;
  color: #fff !important;
}

.text-bg-light,
.text-bg-info,
.text-bg-warning {
  background: rgba(166, 200, 241, 0.18) !important;
  border-color: rgba(166, 200, 241, 0.28) !important;
  color: #f8fbff !important;
}

.text-bg-secondary,
.text-bg-primary,
.text-bg-success,
.text-bg-danger {
  background: linear-gradient(135deg, rgba(13, 53, 96, 0.98) 0%, rgba(22, 79, 134, 0.9) 100%) !important;
  color: #fff !important;
}

.alert,
.alert * {
  color: #f8fbff !important;
}

.alert {
  background: linear-gradient(135deg, rgba(7, 29, 54, 0.96) 0%, rgba(13, 53, 96, 0.9) 100%) !important;
  border-color: rgba(166, 200, 241, 0.24) !important;
}

a:not(.btn):not(.nav-link):not(.dropdown-item),
.alert-link {
  color: #b8d7ff !important;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):hover,
.alert-link:hover {
  color: #ffffff !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(110, 168, 254, 0.18) !important;
  color: #ffffff !important;
}

.xml-preview,
.guide-code,
.import-source-preview,
.import-xml-preview {
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(180deg, #020817 0%, #071527 100%) !important;
  color: #eaf3ff !important;
  border-color: rgba(166, 200, 241, 0.18) !important;
}

.import-validation-guidance,
.import-validation-guidance *,
.import-validation-item,
.import-validation-item * {
  color: #f8fbff !important;
}

.dashboard-stat-card,
.dashboard-stat-card *,
.dashboard-widget-card,
.dashboard-widget-card * {
  color: #f8fbff !important;
}

.dashboard-stat-card {
  background: linear-gradient(180deg, rgba(7, 29, 54, 0.98) 0%, rgba(4, 19, 38, 0.96) 100%) !important;
}

.import-mu3-printable .ccda-print-document,
.import-mu3-printable .ccda-print-document *,
.import-mu3-printable .ccda-narrative,
.import-mu3-printable .ccda-narrative *,
.import-mu3-printable table,
.import-mu3-printable th,
.import-mu3-printable td {
  color: #111827 !important;
}

.import-mu3-printable .ccda-print-badge {
  color: #ffffff !important;
}

/* Final dark control pass for component-specific boxes rendered after generic cards. */
.dashboard-widget-card,
.dashboard-focus-card,
.dashboard-panel-card,
.dashboard-stat-card,
.guide-validation-limitations,
.guide-validation-note,
.guide-purpose-chips span,
.guide-nav-card,
.guide-table-wrap,
.guide-error-reference-section,
.guide-validation-runpath-grid article,
.guide-validation-source-profile,
.guide-validation-example,
.guide-validation-runpath-grid article,
.dashboard-progress-metric,
.patient-field-warning,
.patient-audit-auto,
.patient-clinical-empty,
.section-completeness-card,
.document-detail-type-badge,
.document-status-badge,
.dashboard-document-status-badge,
.settings-type-badge,
.canonical-backfill-blocked-table,
.canonical-backfill-panel,
.validation-sample-modal .modal-content,
.validation-sample-modal .modal-body {
  background:
    linear-gradient(180deg, rgba(7, 29, 54, 0.98) 0%, rgba(4, 19, 38, 0.96) 100%) !important;
  border-color: rgba(166, 200, 241, 0.18) !important;
  color: #f8fbff !important;
}

.dashboard-widget-card *,
.dashboard-focus-card *,
.dashboard-panel-card *,
.dashboard-stat-card *,
.guide-validation-limitations *,
.guide-validation-note *,
.guide-purpose-chips span,
.guide-nav-card *,
.guide-table-wrap *,
.guide-error-reference-section *,
.guide-validation-runpath-grid article *,
.guide-validation-source-profile *,
.guide-validation-example *,
.dashboard-progress-metric *,
.patient-field-warning *,
.patient-audit-auto *,
.patient-clinical-empty *,
.section-completeness-card *,
.document-detail-type-badge *,
.document-status-badge *,
.dashboard-document-status-badge *,
.settings-type-badge *,
.canonical-backfill-blocked-table *,
.canonical-backfill-panel *,
.validation-sample-modal .modal-content *,
.validation-sample-modal .modal-body * {
  color: #f8fbff !important;
}

.dashboard-widget-label,
.dashboard-stat-label,
.guide-flow-kicker,
.guide-flow-label,
.small.text-uppercase,
.text-muted,
.small.text-muted,
.form-text,
.dashboard-widget-meta,
.dashboard-stat-meta,
.guide-validation-limitations p,
.guide-validation-note span,
.guide-purpose-chips span {
  color: #d6e6f8 !important;
}

.dashboard-widget-icon,
.guide-validation-icon,
.guide-flow-icon,
.auth-icon,
.workflow-card-icon,
.workflow-group-icon {
  background: linear-gradient(135deg, #164f86 0%, #6ea8fe 100%) !important;
  color: #ffffff !important;
}

.progress,
.dashboard-progress {
  background: rgba(255, 255, 255, 0.18) !important;
}

.progress-bar,
.dashboard-progress .progress-bar {
  background: linear-gradient(90deg, #6ea8fe 0%, #b8d7ff 100%) !important;
}

.badge,
.badge *,
.chip,
.chip *,
.guide-purpose-chips span,
.sidebar-user-chip,
.sidebar-link-pill {
  color: #f8fbff !important;
}

.badge:not(.text-bg-danger):not(.text-bg-success):not(.text-bg-primary):not(.text-bg-secondary),
.guide-purpose-chips span {
  background: rgba(110, 168, 254, 0.18) !important;
  border-color: rgba(166, 200, 241, 0.28) !important;
}

.table td,
.table th,
.table code,
.guide-table td,
.guide-table th,
.guide-table code {
  color: #f8fbff !important;
}

/* User Guide hard override: no light cards/chips/text on the guide page. */
.guide-page,
.guide-page *,
.guide-page .card,
.guide-page .card *,
.guide-page .card-header,
.guide-page .card-header *,
.guide-page .card-body,
.guide-page .card-body *,
.guide-page .list-group-item,
.guide-page .list-group-item *,
.guide-page .guide-purpose-card,
.guide-page .guide-purpose-card *,
.guide-page .guide-purpose-tile,
.guide-page .guide-purpose-tile *,
.guide-page .guide-purpose-flow-step,
.guide-page .guide-purpose-flow-step *,
.guide-page .guide-purpose-split > div,
.guide-page .guide-purpose-split > div *,
.guide-page .guide-purpose-chips span,
.guide-page .guide-validation-card,
.guide-page .guide-validation-card *,
.guide-page .guide-validation-note,
.guide-page .guide-validation-note *,
.guide-page .guide-validation-limitations,
.guide-page .guide-validation-limitations *,
.guide-page .guide-validation-runpath-grid article,
.guide-page .guide-validation-runpath-grid article *,
.guide-page .guide-flow-card,
.guide-page .guide-flow-card *,
.guide-page .guide-chip-flow span,
.guide-page .guide-flow-examples > div,
.guide-page .guide-flow-examples > div *,
.guide-page .guide-flow-route,
.guide-page .guide-table,
.guide-page .guide-table *,
.guide-page .guide-error-search,
.guide-page .guide-error-search *,
.guide-page .guide-error-table,
.guide-page .guide-error-table *,
.guide-page .guide-code,
.guide-page .guide-code *,
.guide-page code {
  color: #f8fbff !important;
}

.guide-page .card,
.guide-page .card-header,
.guide-page .card-body,
.guide-page .list-group-item,
.guide-page .guide-purpose-card,
.guide-page .guide-purpose-tile,
.guide-page .guide-purpose-flow-step,
.guide-page .guide-purpose-split > div,
.guide-page .guide-purpose-chips span,
.guide-page .guide-validation-card,
.guide-page .guide-validation-note,
.guide-page .guide-validation-limitations,
.guide-page .guide-validation-runpath-grid article,
.guide-page .guide-flow-card,
.guide-page .guide-chip-flow span,
.guide-page .guide-flow-examples > div,
.guide-page .guide-flow-route,
.guide-page .guide-table,
.guide-page .guide-error-search,
.guide-page .guide-error-table,
.guide-page .guide-code,
.guide-page code {
  background:
    linear-gradient(180deg, rgba(7, 29, 54, 0.98) 0%, rgba(4, 19, 38, 0.96) 100%) !important;
  border-color: rgba(166, 200, 241, 0.2) !important;
}

.guide-page .card-header,
.guide-page .guide-nav-feature,
.guide-page .list-group-item.active,
.guide-page .guide-purpose-kicker,
.guide-page .guide-flow-kicker,
.guide-page .guide-flow-label,
.guide-page .guide-validation-icon,
.guide-page .guide-flow-icon,
.guide-page .guide-purpose-icon {
  background: linear-gradient(135deg, #164f86 0%, #6ea8fe 100%) !important;
  color: #ffffff !important;
}

.guide-page .text-muted,
.guide-page .small.text-muted,
.guide-page p,
.guide-page li,
.guide-page td,
.guide-page th,
.guide-page span,
.guide-page strong,
.guide-page h1,
.guide-page h2,
.guide-page h3,
.guide-page h4,
.guide-page h5 {
  color: #f8fbff !important;
}

.guide-page a:not(.btn),
.guide-page a:not(.btn) * {
  color: #b8d7ff !important;
}

.guide-page a:not(.btn):hover,
.guide-page a:not(.btn):hover * {
  color: #ffffff !important;
}

.guide-page .btn,
.guide-page .btn * {
  color: #f8fbff !important;
}

/* C-CDA dark rendering pass.
   The XML viewer and upload preview render HTML from the bundled XSLT, which
   includes its own light document stylesheet. These scoped rules keep the
   clinical document presentation aligned with the portal dark theme. */
.document-xslt-preview,
.document-xslt-preview .ccda-narrative,
.document-xslt-preview .ccda-narrative-complete,
.import-mu3-printable,
.import-mu3-printable .ccda-print-document,
.import-mu3-printable .ccda-print-body,
.import-mu3-printable .ccda-narrative,
.import-mu3-printable .ccda-narrative-complete,
.printable-document-shell .ccda-print-document,
.printable-document-shell .ccda-print-body,
.printable-document-shell .ccda-narrative,
.printable-document-shell .ccda-narrative-complete {
  background:
    radial-gradient(circle at top right, rgba(54, 111, 177, 0.18), transparent 28%),
    linear-gradient(180deg, #020817 0%, #071527 100%) !important;
  color: #f8fbff !important;
}

.document-xslt-preview .ccda-render-header,
.document-xslt-preview .ccda-section-index,
.document-xslt-preview .ccda-mu3-panel,
.document-xslt-preview .ccda-section,
.document-xslt-preview .ccda-render-meta-card,
.document-xslt-preview .ccda-section-index-item,
.document-xslt-preview .ccda-empty-state,
.document-xslt-preview .ccda-entry-fallback,
.import-mu3-printable .ccda-print-header,
.import-mu3-printable .ccda-print-meta-card,
.import-mu3-printable .ccda-section,
.import-mu3-printable .ccda-section-index,
.import-mu3-printable .ccda-mu3-panel,
.import-mu3-printable .ccda-render-header,
.import-mu3-printable .ccda-render-meta-card,
.import-mu3-printable .ccda-section-index-item,
.import-mu3-printable .ccda-empty-state,
.import-mu3-printable .ccda-entry-fallback,
.printable-document-shell .ccda-print-header,
.printable-document-shell .ccda-print-meta-card,
.printable-document-shell .ccda-section,
.printable-document-shell .ccda-section-index,
.printable-document-shell .ccda-mu3-panel,
.printable-document-shell .ccda-render-header,
.printable-document-shell .ccda-render-meta-card,
.printable-document-shell .ccda-section-index-item,
.printable-document-shell .ccda-empty-state,
.printable-document-shell .ccda-entry-fallback {
  background:
    linear-gradient(180deg, rgba(7, 29, 54, 0.98) 0%, rgba(4, 19, 38, 0.96) 100%) !important;
  border-color: rgba(166, 200, 241, 0.2) !important;
  color: #f8fbff !important;
  box-shadow: none !important;
}

.document-xslt-preview .ccda-section-header,
.import-mu3-printable .ccda-section-header,
.printable-document-shell .ccda-section-header {
  background: linear-gradient(90deg, rgba(13, 53, 96, 0.98) 0%, rgba(22, 79, 134, 0.92) 100%) !important;
  border-color: rgba(166, 200, 241, 0.2) !important;
}

.document-xslt-preview .ccda-narrative *,
.import-mu3-printable .ccda-print-document *,
.import-mu3-printable .ccda-narrative *,
.printable-document-shell .ccda-print-document *,
.printable-document-shell .ccda-narrative * {
  color: #f8fbff !important;
}

.document-xslt-preview .ccda-render-kicker,
.document-xslt-preview .ccda-render-subtitle,
.document-xslt-preview .ccda-render-meta-label,
.document-xslt-preview .ccda-render-meta-note,
.document-xslt-preview .ccda-section-index-title,
.document-xslt-preview .ccda-section-index-code,
.document-xslt-preview .ccda-section-meta,
.document-xslt-preview .ccda-mu3-note,
.import-mu3-printable .ccda-print-kicker,
.import-mu3-printable .ccda-print-subtitle,
.import-mu3-printable .ccda-print-meta-label,
.import-mu3-printable .ccda-print-meta-note,
.import-mu3-printable .ccda-render-kicker,
.import-mu3-printable .ccda-render-subtitle,
.import-mu3-printable .ccda-render-meta-label,
.import-mu3-printable .ccda-render-meta-note,
.import-mu3-printable .ccda-section-index-title,
.import-mu3-printable .ccda-section-index-code,
.import-mu3-printable .ccda-section-meta,
.import-mu3-printable .ccda-mu3-note,
.printable-document-shell .ccda-print-kicker,
.printable-document-shell .ccda-print-subtitle,
.printable-document-shell .ccda-print-meta-label,
.printable-document-shell .ccda-print-meta-note,
.printable-document-shell .ccda-render-kicker,
.printable-document-shell .ccda-render-subtitle,
.printable-document-shell .ccda-render-meta-label,
.printable-document-shell .ccda-render-meta-note,
.printable-document-shell .ccda-section-index-title,
.printable-document-shell .ccda-section-index-code,
.printable-document-shell .ccda-section-meta,
.printable-document-shell .ccda-mu3-note {
  color: #c8daf0 !important;
}

.document-xslt-preview .ccda-narrative table,
.document-xslt-preview .ccda-narrative th,
.document-xslt-preview .ccda-narrative td,
.import-mu3-printable table,
.import-mu3-printable th,
.import-mu3-printable td,
.printable-document-shell table,
.printable-document-shell th,
.printable-document-shell td {
  background: rgba(4, 19, 38, 0.72) !important;
  border-color: rgba(166, 200, 241, 0.16) !important;
  color: #f8fbff !important;
}

.document-xslt-preview .ccda-narrative th,
.import-mu3-printable th,
.printable-document-shell th {
  background: linear-gradient(90deg, rgba(13, 53, 96, 0.98) 0%, rgba(22, 79, 134, 0.92) 100%) !important;
}

.document-xslt-preview .ccda-narrative tr:nth-child(even) td,
.import-mu3-printable tr:nth-child(even) td,
.printable-document-shell tr:nth-child(even) td {
  background: rgba(22, 79, 134, 0.18) !important;
}

.document-xslt-preview .ccda-mu3-status,
.import-mu3-printable .ccda-mu3-status,
.printable-document-shell .ccda-mu3-status,
.import-mu3-printable .ccda-print-badge,
.printable-document-shell .ccda-print-badge {
  background: rgba(110, 168, 254, 0.2) !important;
  border: 1px solid rgba(166, 200, 241, 0.28) !important;
  color: #ffffff !important;
}

.document-xslt-preview .ccda-mu3-missing,
.import-mu3-printable .ccda-mu3-missing,
.printable-document-shell .ccda-mu3-missing {
  background: rgba(185, 28, 28, 0.35) !important;
}

.document-xslt-preview .ccda-mu3-empty,
.import-mu3-printable .ccda-mu3-empty,
.printable-document-shell .ccda-mu3-empty {
  background: rgba(217, 119, 6, 0.3) !important;
}

/* User guide final coverage for markdown-generated content and Bootstrap utility remnants. */
.guide-page .table,
.guide-page .table > :not(caption) > * > *,
.guide-page .guide-content table,
.guide-page .guide-content th,
.guide-page .guide-content td,
.guide-page .modal-content,
.guide-page .modal-header,
.guide-page .modal-body,
.guide-page .modal-footer,
.guide-page .bg-white,
.guide-page .bg-light,
.guide-page .bg-body-tertiary,
.guide-page .bg-primary-subtle,
.guide-page .alert,
.guide-page .form-control,
.guide-page .form-select {
  background:
    linear-gradient(180deg, rgba(7, 29, 54, 0.98) 0%, rgba(4, 19, 38, 0.96) 100%) !important;
  border-color: rgba(166, 200, 241, 0.2) !important;
  color: #f8fbff !important;
}

.guide-page .table thead,
.guide-page .guide-content th,
.guide-page .modal-header {
  background: linear-gradient(90deg, rgba(13, 53, 96, 0.98) 0%, rgba(22, 79, 134, 0.92) 100%) !important;
}

@media (max-width: 1199.98px) {
  .patient-corrections-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    padding: 2rem 1.5rem 0;
    align-items: stretch;
  }

  .app-main,
  .app-header {
    margin-left: 0 !important;
  }

  .app-sidebar {
    position: static;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: auto;
  }
}
