:root {
  --oa-primary: #f49d36;
  --oa-secondary: #252159;
  --oa-cream: #fff9f2;
  --oa-ink: #17152d;
  --app-bg: #eef2f9;
  --app-surface: rgba(255, 255, 255, 0.94);
  --app-surface-soft: rgba(248, 249, 255, 0.92);
  --app-border: rgba(37, 33, 89, 0.08);
  --app-text: #252159;
  --app-text-muted: rgba(37, 33, 89, 0.62);
}

:root[data-theme="dark"] {
  --app-bg: #070c19;
  --app-surface: rgba(16, 24, 43, 0.96);
  --app-surface-soft: rgba(21, 31, 52, 0.94);
  --app-border: rgba(148, 163, 184, 0.2);
  --app-text: #f8fbff;
  --app-text-muted: #bfd0ea;
  --app-link: #8fb7ff;
  --app-accent: #ffb45d;
  --app-control: #17233d;
  --oa-cream: #0c1426;
  --oa-ink: #f5f7ff;
}

.btn.bg-gradient-primary,
.btn-primary {
  background: linear-gradient(310deg, var(--oa-primary), #ffb35d);
  border-color: var(--oa-primary);
}

.btn-outline-primary {
  color: var(--oa-primary);
  border-color: var(--oa-primary);
}

.navbar-main,
.sidenav .navbar-brand,
.monitor-banner {
  background: linear-gradient(310deg, rgba(37, 33, 89, 0.95), rgba(244, 157, 54, 0.92));
  color: #fff;
}

.navbar-main h6,
.navbar-main .nav-link,
.monitor-banner h3,
.monitor-banner p {
  color: #fff;
}

.sidenav .nav-link.active,
.sidenav .nav-link:hover {
  background-color: rgba(244, 157, 54, 0.12);
  color: var(--oa-secondary);
}

.sidenav .nav-link.active .nav-link-text,
.sidenav .nav-link:hover .nav-link-text {
  font-weight: 700;
}

.alert-info,
.alert-success {
  background: linear-gradient(310deg, var(--oa-secondary), var(--oa-primary));
  border: none;
}

.monitor-entry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid #f0f2f5;
  font-size: 1rem;
}

.logout-form {
  display: inline-flex;
  align-items: center;
}

.logout-button {
  background: transparent;
  border: 0;
  cursor: pointer;
}

.app-sidenav {
  left: auto;
  right: 0;
  transform: translateX(0);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  z-index: 1040;
}

.main-content {
  margin-right: 20rem;
  margin-left: 0;
  transition: margin 0.28s ease;
}

.dashboard-menu-button,
.sidebar-close-button {
  text-decoration: none;
}

.dashboard-menu-button {
  display: none;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 21, 45, 0.42);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  z-index: 1030;
}

.landing-body {
  background:
    radial-gradient(circle at top left, rgba(244, 157, 54, 0.25), transparent 28%),
    radial-gradient(circle at top right, rgba(37, 33, 89, 0.18), transparent 32%),
    linear-gradient(180deg, #fffaf4 0%, #ffffff 55%, #f6f7fb 100%);
  color: var(--oa-ink);
}

.landing-shell {
  min-height: 100vh;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(23, 21, 45, 0.06);
}

.landing-nav-row {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--oa-secondary);
  font-weight: 700;
}

.landing-logo-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--oa-secondary), var(--oa-primary));
  box-shadow: 0 12px 30px rgba(37, 33, 89, 0.24);
}

.landing-links {
  gap: 1.25rem;
}

.landing-links a {
  color: #5e6282;
  font-weight: 600;
}

.landing-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.landing-hero {
  padding: 5rem 0 4rem;
}

.landing-title {
  font-size: clamp(2.75rem, 5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--oa-secondary);
  margin: 1rem 0 1.25rem;
}

.landing-subtitle,
.landing-copy {
  font-size: 1.08rem;
  line-height: 1.8;
  color: #5f647f;
}

.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.landing-ghost {
  border-color: rgba(37, 33, 89, 0.16);
  color: var(--oa-secondary);
  background: rgba(255, 255, 255, 0.72);
}

.landing-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  color: var(--oa-secondary);
  font-weight: 600;
}

.landing-proof span {
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(37, 33, 89, 0.06);
}

.hero-stage {
  position: relative;
  min-height: 520px;
}

.hero-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(12px);
}

.hero-glow-one {
  top: 10%;
  left: 10%;
  width: 200px;
  height: 200px;
  background: rgba(244, 157, 54, 0.25);
}

.hero-glow-two {
  right: 5%;
  bottom: 8%;
  width: 220px;
  height: 220px;
  background: rgba(37, 33, 89, 0.18);
}

.hero-panel {
  position: relative;
  z-index: 2;
  padding: 1.25rem;
  border-radius: 30px;
  background: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(255,245,232,0.95));
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 30px 70px rgba(37, 33, 89, 0.12);
}

.hero-panel-top {
  display: flex;
  gap: 0.45rem;
  padding-bottom: 1rem;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(37, 33, 89, 0.2);
}

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

.hero-metric,
.hero-wide,
.feature-card,
.pricing-promo,
.auth-card {
  border: 1px solid rgba(37, 33, 89, 0.08);
  box-shadow: 0 16px 40px rgba(37, 33, 89, 0.08);
}

.hero-metric {
  padding: 1.35rem;
  border-radius: 22px;
  background: #fff;
}

.hero-metric span {
  color: #7a7f9c;
}

.hero-metric strong {
  display: block;
  font-size: 2.2rem;
  color: var(--oa-secondary);
}

.hero-wide {
  grid-column: span 2;
  padding: 1.5rem;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff, #fff8ef);
}

.landing-section {
  padding: 4.5rem 0;
}

.logo-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 22px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(37, 33, 89, 0.08);
  color: #626781;
  font-weight: 700;
}

.section-intro {
  max-width: 720px;
  margin-bottom: 2.5rem;
}

.section-kicker {
  display: inline-block;
  margin-bottom: 0.8rem;
  color: var(--oa-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.section-intro h2,
.pricing-copy h3 {
  color: var(--oa-secondary);
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.feature-card {
  height: 100%;
  padding: 2rem;
  border-radius: 26px;
  background: rgba(255,255,255,0.88);
}

.feature-card-dark {
  background: linear-gradient(180deg, var(--oa-secondary), #3a3477);
  color: #fff;
}

.feature-card-dark p {
  color: rgba(255,255,255,0.8);
}

.feature-card-accent {
  background: linear-gradient(180deg, rgba(244,157,54,0.16), rgba(255,255,255,0.95));
}

.workflow-band {
  background: linear-gradient(135deg, var(--oa-secondary), #342f73);
}

.section-intro-light h2,
.section-intro-light .section-kicker {
  color: #fff;
}

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

.workflow-step {
  padding: 1.5rem;
  border-radius: 24px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
}

.workflow-step strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--oa-primary), #ffbf70);
  color: var(--oa-secondary);
}

.pricing-promo {
  padding: 2rem;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(37,33,89,0.95), rgba(244,157,54,0.92));
  color: #fff;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.pricing-promo h3,
.pricing-promo p {
  color: #fff;
}

.auth-shell {
  background:
    radial-gradient(circle at top right, rgba(244, 157, 54, 0.24), transparent 28%),
    linear-gradient(135deg, #fbf5ed 0%, #f4f6fb 52%, #ffffff 100%);
}

.auth-brand-panel {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  overflow: hidden;
  background: linear-gradient(140deg, var(--oa-secondary), #413981 60%, #f49d36 160%);
}

.auth-brand-panel-alt {
  background: linear-gradient(160deg, #201b4d, #463d91 60%, #f49d36 170%);
}

.auth-brand-panel::before,
.auth-brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.auth-brand-panel::before {
  width: 280px;
  height: 280px;
  top: -60px;
  right: -50px;
}

.auth-brand-panel::after {
  width: 180px;
  height: 180px;
  bottom: 30px;
  left: -40px;
}

.auth-brand-copy {
  position: relative;
  z-index: 2;
  max-width: 520px;
  color: #fff;
}

.auth-brand-copy h1 {
  color: #fff;
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 1.06;
  margin: 1rem 0;
}

.auth-brand-copy p {
  color: rgba(255,255,255,0.82);
  font-size: 1.05rem;
  line-height: 1.8;
}

.auth-card {
  width: 100%;
  max-width: 560px;
  margin: 2rem auto;
  border-radius: 32px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(12px);
}

.auth-card-wide {
  max-width: 760px;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(244, 157, 54, 0.12);
  color: var(--oa-primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-chip-light {
  background: rgba(37, 33, 89, 0.08);
  color: var(--oa-secondary);
}

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

.auth-stat-grid div {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.1);
}

.auth-stat-grid strong,
.auth-stat-grid span {
  display: block;
}

.auth-stat-grid strong {
  margin-bottom: 0.35rem;
}

.auth-form-grid p {
  margin-bottom: 1rem;
}

.auth-form-grid label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
  color: var(--oa-secondary);
}

.auth-form-grid input,
.auth-form-grid select,
.auth-form-grid textarea,
form p input,
form p select,
form p textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(37, 33, 89, 0.12);
  background: #fff;
}

.auth-form-grid ul.errorlist,
form ul.errorlist {
  list-style: none;
  padding-left: 0;
  margin: 0.35rem 0 0;
  color: #c0392b;
  font-size: 0.9rem;
}

@media (max-width: 991.98px) {
  .workflow-grid,
  .hero-panel-grid {
    grid-template-columns: 1fr;
  }

  .hero-wide {
    grid-column: auto;
  }

  .pricing-promo {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 1199.98px) {
  .app-sidenav {
    top: 0;
    right: 0;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    transform: translateX(100%);
    width: min(86vw, 320px);
    box-shadow: -24px 0 60px rgba(23, 21, 45, 0.22);
  }

  .main-content {
    margin-right: 0;
  }

  .dashboard-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.sidebar-open .app-sidenav {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }
}

/* OT monitoring interface */
:root {
  --primary: #f49d36;
  --secondary: #252159;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --font-base: 14px;
  --font-large: 18px;
  --radius: 8px;
  --ot-bg: #0f1327;
  --ot-panel: #171d39;
  --ot-border: rgba(255, 255, 255, 0.08);
  --ot-text: #f4f6fb;
  --ot-muted: #9ea2d0;
}

.ot-body {
  background:
    radial-gradient(circle at top left, rgba(244, 157, 54, 0.12), transparent 24%),
    linear-gradient(180deg, #0d1124 0%, #090c18 100%);
  color: var(--ot-text);
  min-height: 100vh;
}

.ot-main-shell {
  padding: 1rem;
}

.ot-live-shell {
  display: grid;
  gap: 1rem;
}

.ot-patient-bar,
.ot-panel,
.ot-chart-panel {
  background: rgba(23, 29, 57, 0.92);
  border: 1px solid var(--ot-border);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.ot-patient-bar {
  position: sticky;
  top: 0.75rem;
  z-index: 30;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  backdrop-filter: blur(18px);
}

.ot-patient-bar__main,
.ot-patient-meta,
.ot-patient-bar__actions,
.ot-panel__header,
.ot-panel__actions,
.ot-shortcut-hints,
.ot-alert-banner,
.ot-vital-card__meta {
  display: flex;
  align-items: center;
}

.ot-patient-bar__main,
.ot-patient-meta {
  gap: 1.25rem;
}

.ot-patient-bar__actions {
  gap: 0.75rem;
}

.ot-label {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ot-muted);
}

.ot-patient-bar h1,
.ot-patient-bar h2,
.ot-panel__title {
  margin: 0;
  color: #fff;
}

.ot-patient-bar h1 {
  font-size: 1.9rem;
}

.ot-patient-bar h2 {
  font-size: 1rem;
}

.ot-clock {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ot-chip-button,
.ot-primary-button,
.ot-quick-button {
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.ot-chip-button {
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.ot-chip-button--link {
  text-decoration: none;
}

.ot-primary-button {
  width: 100%;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, var(--primary), #ffbf70);
  color: #1f1632;
}

.ot-quick-button {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ot-text);
}

.ot-quick-button--ghost {
  background: rgba(244, 157, 54, 0.16);
  color: #ffd9ab;
}

.ot-quick-button--warning {
  background: rgba(255, 193, 7, 0.16);
  color: #ffe596;
}

.ot-quick-button--danger {
  background: rgba(220, 53, 69, 0.16);
  color: #ffb5bc;
}

.ot-chip-button:hover,
.ot-primary-button:hover,
.ot-quick-button:hover {
  transform: translateY(-1px);
}

.ot-status-banner,
.ot-alert-stack {
  display: grid;
  gap: 0.75rem;
}

.ot-status-banner {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(40, 167, 69, 0.16);
  color: #8ef0a9;
  border: 1px solid rgba(40, 167, 69, 0.22);
}

.ot-alert-banner {
  justify-content: flex-start;
  gap: 0.9rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid transparent;
}

.ot-alert-banner__label {
  min-width: 86px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ot-alert-banner--critical {
  background: rgba(220, 53, 69, 0.16);
  color: #ffb5bc;
  border-color: rgba(220, 53, 69, 0.3);
}

.ot-alert-banner--warning {
  background: rgba(255, 193, 7, 0.16);
  color: #ffe596;
  border-color: rgba(255, 193, 7, 0.3);
}

.ot-alert-banner--dangerous {
  background: rgba(249, 115, 22, 0.16);
  color: #fed7aa;
  border-color: rgba(249, 115, 22, 0.35);
}

.ot-alert-banner--pulse,
.ot-vital-card--critical {
  animation: otCriticalPulse 1.15s infinite;
}

.ot-vitals-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.ot-vital-card {
  padding: 1.1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(32, 40, 74, 0.94), rgba(18, 24, 46, 0.98));
  border: 1px solid var(--ot-border);
}

.ot-vital-card--normal {
  box-shadow: inset 0 0 0 1px rgba(40, 167, 69, 0.18);
}

.ot-vital-card--warning {
  box-shadow: inset 0 0 0 1px rgba(255, 193, 7, 0.22);
}

.ot-vital-card--dangerous {
  box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.34);
}

.ot-vital-card--critical {
  box-shadow: inset 0 0 0 2px rgba(220, 53, 69, 0.44);
}

.ot-vital-card__label,
.ot-panel__subtitle,
.ot-vital-card__unit,
.ot-shortcut-hints span {
  color: var(--ot-muted);
}

.ot-vital-card__value {
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 800;
  line-height: 1;
  margin: 0.6rem 0 0.35rem;
  color: #fff;
}

.ot-vital-card__trend {
  width: 2rem;
  height: 2rem;
  justify-content: center;
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.ot-vital-card__trend--up {
  color: #8ef0a9;
}

.ot-vital-card__trend--down {
  color: #ffb5bc;
}

.ot-chart-panel,
.ot-panel {
  padding: 1rem 1.1rem;
}

.ot-chart-panel {
  min-height: 360px;
}

.ot-chart-frame {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 280px;
}

.ot-chart-frame__inner {
  position: relative;
  width: min(100%, 980px);
  height: 320px;
  padding: 0.85rem 1rem 0.65rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10, 14, 28, 0.96), rgba(18, 24, 46, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(244, 157, 54, 0.06);
}

.ot-chart-panel canvas {
  width: 100% !important;
  height: 100% !important;
}

.ot-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(320px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.ot-panel__header {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.ot-table-wrap {
  overflow-x: auto;
}

.ot-monitoring-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.55rem;
}

.ot-monitoring-table th,
.ot-monitoring-table td {
  text-align: left;
  padding: 0.2rem 0.35rem;
  color: var(--ot-text);
  vertical-align: middle;
}

.ot-monitoring-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ot-muted);
}

.ot-monitoring-table__input-row td,
.ot-monitoring-table__data-row td {
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ot-monitoring-table__data-row.is-warning td {
  background: rgba(255, 193, 7, 0.12);
}

.ot-monitoring-table__data-row.is-dangerous td {
  background: rgba(249, 115, 22, 0.14);
}

.ot-monitoring-table__data-row.is-critical td {
  background: rgba(220, 53, 69, 0.16);
}

.ot-monitoring-table__input-row td:first-child,
.ot-monitoring-table__data-row td:first-child {
  border-radius: 12px 0 0 12px;
}

.ot-monitoring-table__input-row td:last-child,
.ot-monitoring-table__data-row td:last-child {
  border-radius: 0 12px 12px 0;
}

.ot-table-input {
  width: 100%;
  min-height: 50px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(8, 12, 26, 0.96);
  color: #fff;
  padding: 0.78rem 0.85rem;
  font-size: 1rem;
}

.ot-table-input:focus {
  outline: none;
  border-color: rgba(244, 157, 54, 0.75);
  box-shadow: 0 0 0 3px rgba(244, 157, 54, 0.18);
}

.ot-table-notes {
  min-width: 180px;
}

.ot-bp-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(70px, 1fr));
  gap: 0.45rem;
}

.ot-empty-state {
  padding: 1rem 0.5rem;
  color: var(--ot-muted);
}

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

.ot-shortcut-hints {
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.82rem;
}

.ot-shortcut-hints span {
  padding: 0.4rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.ot-toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: grid;
  gap: 0.6rem;
}

.ot-toast-stack--server {
  top: 1rem;
  right: 1rem;
  bottom: auto;
}

.ot-toast {
  min-width: 220px;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(40, 167, 69, 0.18);
  border: 1px solid rgba(40, 167, 69, 0.24);
  color: #b2f1c2;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.ot-toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.ot-monitoring-mode .ot-chart-panel,
.ot-monitoring-mode .ot-shortcut-hints {
  display: none;
}

.ot-monitoring-mode .ot-vitals-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@keyframes otCriticalPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.28);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(220, 53, 69, 0.06);
  }
}

@media (max-width: 1200px) {
  .ot-vitals-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ot-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .ot-main-shell {
    padding: 0.75rem;
  }

  .ot-patient-bar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  .ot-patient-bar__main,
  .ot-patient-meta,
  .ot-patient-bar__actions,
  .ot-panel__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ot-vitals-grid,
  .ot-quick-grid,
  .ot-monitoring-mode .ot-vitals-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ot-chart-panel {
    min-height: 240px;
  }

  .ot-chart-frame__inner {
    height: 280px;
  }
}

@media (max-width: 560px) {
  .ot-vitals-grid,
  .ot-quick-grid,
  .ot-monitoring-mode .ot-vitals-grid {
    grid-template-columns: 1fr;
  }

  .ot-patient-bar h1 {
    font-size: 1.55rem;
  }

  .ot-chart-frame__inner {
    height: 240px;
    padding: 0.7rem 0.75rem 0.55rem;
  }
}

/* Shared UI system */
.ui-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ui-page-header__eyebrow,
.ui-card__eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: rgba(37, 33, 89, 0.55);
}

.ui-page-header__title {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--oa-secondary);
}

.ui-page-header__subtitle,
.ui-card__subtitle,
.ui-empty-copy,
.ui-activity-row p {
  margin: 0.35rem 0 0;
  color: rgba(37, 33, 89, 0.62);
}

.ui-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  min-height: 46px;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.ui-button:hover {
  transform: translateY(-1px);
}

.ui-button--primary {
  background: linear-gradient(135deg, var(--oa-primary), #f7bb6d);
  color: #2b1e10;
  box-shadow: 0 18px 32px rgba(244, 157, 54, 0.24);
}

.ui-button--secondary,
.ui-button--ghost {
  background: rgba(37, 33, 89, 0.05);
  color: var(--oa-secondary);
  border-color: rgba(37, 33, 89, 0.08);
}

.ui-button--sm {
  min-height: 38px;
  padding: 0.65rem 0.9rem;
}

.ui-card,
.ui-table-shell {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(37, 33, 89, 0.08);
  border-radius: 22px;
  box-shadow: 0 22px 44px rgba(24, 21, 46, 0.08);
}

.ui-card__header,
.ui-table-shell__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0;
}

.ui-card__body,
.ui-table-shell__body {
  padding: 1.25rem;
}

.ui-card__title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--oa-secondary);
}

.ui-card--center .ui-card__body {
  text-align: center;
  padding: 2rem;
}

.ui-form-shell {
  max-width: 880px;
}

.ui-form-grid {
  display: grid;
  gap: 1rem;
}

.ui-field {
  display: grid;
  gap: 0.45rem;
}

.ui-field__label {
  font-weight: 700;
  color: var(--oa-secondary);
}

.ui-input,
.auth-form-grid .ui-input {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(37, 33, 89, 0.12);
  background: #fff;
  color: #1e1b37;
  padding: 0.85rem 1rem;
}

.ui-input:focus {
  outline: none;
  border-color: rgba(244, 157, 54, 0.72);
  box-shadow: 0 0 0 4px rgba(244, 157, 54, 0.16);
}

.ui-field__help {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(37, 33, 89, 0.5);
}

.ui-field__error {
  margin: 0;
  font-size: 0.88rem;
  color: #c0392b;
}

.ui-form-errors {
  display: grid;
  gap: 0.75rem;
}

.ui-alert {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  font-weight: 600;
}

.ui-alert--info {
  background: rgba(37, 33, 89, 0.08);
  color: var(--oa-secondary);
}

.ui-alert--warning {
  background: rgba(255, 193, 7, 0.16);
  color: #8b6200;
}

.ui-alert--danger {
  background: rgba(220, 53, 69, 0.12);
  color: #aa2434;
}

.ui-alert--success {
  background: rgba(40, 167, 69, 0.12);
  color: #1f7b35;
}

.ui-table-shell--span {
  min-width: 0;
}

.ui-table {
  width: 100%;
  border-collapse: collapse;
}

.ui-table th,
.ui-table td {
  padding: 0.95rem 0.85rem;
  border-bottom: 1px solid rgba(37, 33, 89, 0.08);
  text-align: left;
}

.ui-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(37, 33, 89, 0.55);
}

.ui-table__empty {
  text-align: center;
  color: rgba(37, 33, 89, 0.58);
}

.ui-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(37, 33, 89, 0.08);
  color: var(--oa-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.ui-stat-grid,
.ui-split-grid,
.ui-plan-grid {
  display: grid;
  gap: 1rem;
}

.ui-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.ui-stat-card {
  padding: 1.15rem 1.2rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.88));
  border: 1px solid rgba(37, 33, 89, 0.08);
  box-shadow: 0 18px 38px rgba(24, 21, 46, 0.08);
}

.ui-stat-card p {
  margin: 0 0 0.55rem;
  color: rgba(37, 33, 89, 0.58);
}

.ui-stat-card h2,
.ui-price {
  margin: 0;
  color: var(--oa-secondary);
}

.ui-price {
  font-size: 2rem;
  font-weight: 800;
}

.ui-price span {
  font-size: 1rem;
  color: rgba(37, 33, 89, 0.52);
}

.ui-split-grid {
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
}

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

.ui-activity-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(37, 33, 89, 0.08);
}

.ui-activity-row:last-child {
  border-bottom: 0;
}

.ui-stack {
  display: grid;
}

.ui-stack--gap {
  gap: 1rem;
}

.ui-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(9, 12, 24, 0.45);
}

.ui-modal__dialog {
  width: min(680px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 1.25rem;
}

.ui-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ui-modal__close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
}

.ui-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.ui-stepper__item {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(37, 33, 89, 0.06);
  color: rgba(37, 33, 89, 0.58);
  font-size: 0.9rem;
  font-weight: 700;
}

.ui-stepper__item--active {
  background: rgba(244, 157, 54, 0.18);
  color: #8f5400;
}

.ui-stepper__item--done {
  background: rgba(40, 167, 69, 0.14);
  color: #1f7b35;
}

.ui-summary-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(37, 33, 89, 0.04);
  border: 1px solid rgba(37, 33, 89, 0.08);
}

.ui-summary-panel__label {
  display: block;
  margin-bottom: 0.3rem;
  color: rgba(37, 33, 89, 0.56);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 991.98px) {
  .ui-page-header,
  .ui-card__header,
  .ui-table-shell__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ui-stat-grid,
  .ui-plan-grid,
  .ui-split-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767.98px) {
  .ui-stat-grid,
  .ui-plan-grid,
  .ui-split-grid {
    grid-template-columns: 1fr;
  }

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

  .ui-table {
    min-width: 640px;
  }
}

@media print {
  .ui-page-header__actions,
  .mw-sidebar,
  .ot-sidebar,
  .site-sidebar,
  .ui-button {
    display: none !important;
  }

  body,
  .ui-card,
  .summary-hero {
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
  }

  .ui-card {
    break-inside: avoid;
    border: 1px solid #d1d5db !important;
  }
}

/* Dashboard redesign */
.dashboard-body {
  background:
    radial-gradient(circle at top left, rgba(244, 157, 54, 0.14), transparent 22%),
    radial-gradient(circle at top right, rgba(37, 33, 89, 0.08), transparent 28%),
    linear-gradient(180deg, #f7f8fc 0%, var(--app-bg) 100%);
  color: var(--app-text);
}

.dashboard-main {
  padding-right: 0.75rem;
}

.dashboard-content-shell {
  padding-top: 1rem;
}

.dashboard-topbar {
  margin-top: 1rem;
}

.dashboard-topbar .container-fluid {
  min-height: 82px;
  border-radius: 28px;
  background: linear-gradient(135deg, #f0a041 0%, #7a5878 46%, #2f2d67 100%);
  box-shadow: 0 24px 54px rgba(37, 33, 89, 0.18);
}

.dashboard-topbar__brand {
  display: grid;
}

.dashboard-topbar__eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}

.dashboard-topbar h6 {
  color: #fff;
  font-size: 1.1rem;
}

.dashboard-topbar__actions {
  gap: 0.9rem;
}

.dashboard-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.65rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
}

.dashboard-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.75rem 0.45rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.dashboard-user-pill__avatar {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
  font-weight: 800;
}

.logout-button {
  padding: 0.75rem 1rem !important;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12) !important;
}

.app-sidenav {
  width: 320px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, var(--app-surface), var(--app-surface-soft)) !important;
  border: 1px solid var(--app-border);
  box-shadow: 0 30px 60px rgba(24, 21, 46, 0.12);
  overflow: hidden;
}

.sidenav-header {
  padding: 1.35rem 1.35rem 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.dashboard-sidebar__brand-icon {
  width: 3.2rem;
  height: 3.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #f0a041, #2f2d67);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 14px 28px rgba(47, 45, 103, 0.22);
}

.dashboard-sidebar__brand-copy {
  display: grid;
}

.dashboard-sidebar__brand-title {
  font-weight: 800;
  color: var(--app-text);
  font-size: 1rem;
}

.dashboard-sidebar__brand-subtitle {
  max-width: 180px;
  color: var(--app-text-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.dashboard-sidebar__section-label {
  padding: 0 1.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--app-text-muted);
}

.app-sidenav .navbar-nav {
  gap: 0.4rem;
  padding: 0 1rem;
}

.app-sidenav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 54px;
  border-radius: 18px;
  color: var(--app-text-muted);
  font-weight: 700;
  transition: all 0.18s ease;
}

.app-sidenav .nav-link:hover {
  transform: translateX(-2px);
  background: rgba(244, 157, 54, 0.08);
}

.app-sidenav .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, #f0a041, #2f2d67);
  box-shadow: 0 18px 34px rgba(47, 45, 103, 0.18);
}

.dashboard-sidebar__nav-icon {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(244, 157, 54, 0.08);
  color: inherit;
  flex-shrink: 0;
}

.app-sidenav .nav-link.active .dashboard-sidebar__nav-icon {
  background: rgba(255, 255, 255, 0.18);
}

.dashboard-sidebar__footer {
  margin: auto 1.2rem 1.2rem;
  padding: 1rem 1.05rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(244, 157, 54, 0.12), rgba(37, 33, 89, 0.06));
  color: var(--app-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.dashboard-hero {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1rem;
  padding: 1.75rem 1.8rem;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.55), transparent 28%),
    linear-gradient(135deg, rgba(255,248,239,0.96) 0%, var(--app-surface) 38%, rgba(242,245,255,0.96) 100%);
  border: 1px solid var(--app-border);
  box-shadow: 0 28px 56px rgba(24, 21, 46, 0.08);
}

.dashboard-hero__content {
  max-width: 760px;
}

.dashboard-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.dashboard-hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(244, 157, 54, 0.08);
  color: var(--app-text-muted);
  font-weight: 600;
}

.dashboard-hero__actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
  min-width: 190px;
}

.ui-page-header {
  align-items: stretch;
}

.ui-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  margin: 1.4rem 0 1.6rem;
}

.ui-stat-card {
  position: relative;
  overflow: hidden;
  min-height: 164px;
  padding: 1.35rem 1.35rem 1.2rem;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.72), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(250,251,255,0.9));
}

.ui-stat-card__icon {
  position: absolute;
  right: 1.1rem;
  top: 1.05rem;
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(37, 33, 89, 0.06);
  color: var(--oa-secondary);
  font-size: 1.1rem;
}

.ui-stat-card h2 {
  font-size: 2.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.ui-stat-card p {
  font-size: 0.95rem;
  font-weight: 700;
}

.ui-stat-card--hospitals {
  background: linear-gradient(180deg, #fffaf2, #fff);
}

.ui-stat-card--patients {
  background: linear-gradient(180deg, #f7fbff, #fff);
}

.ui-stat-card--cases {
  background: linear-gradient(180deg, #f8f7ff, #fff);
}

.ui-stat-card--billing {
  background: linear-gradient(180deg, #fff8fb, #fff);
}

.ui-split-grid {
  align-items: start;
  gap: 1.2rem;
}

.ui-card,
.ui-table-shell {
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 56px rgba(24, 21, 46, 0.08);
}

.ui-card__header,
.ui-table-shell__header {
  padding: 1.45rem 1.45rem 0;
}

.ui-card__body,
.ui-table-shell__body {
  padding: 1.35rem 1.45rem 1.45rem;
}

.ui-card__title {
  font-size: 1.22rem;
}

.dashboard-empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(37, 33, 89, 0.025), rgba(37, 33, 89, 0.01));
  text-align: center;
}

.dashboard-empty-state i {
  font-size: 2rem;
  color: rgba(37, 33, 89, 0.34);
  margin-bottom: 0.75rem;
}

.dashboard-subscription-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 0.18rem;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 18px;
  background: rgba(37, 33, 89, 0.05);
  color: var(--oa-secondary);
}

.dashboard-subscription-chip span {
  color: rgba(37, 33, 89, 0.62);
  font-size: 0.9rem;
}

.dashboard-locked-shell {
  position: relative;
}

.dashboard-locked-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 1rem;
  border-radius: 28px;
  backdrop-filter: blur(8px);
  background: rgba(247, 248, 252, 0.72);
}

.dashboard-locked-card {
  width: min(460px, 100%);
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(37, 33, 89, 0.08);
  box-shadow: 0 28px 56px rgba(24, 21, 46, 0.12);
}

.dashboard-locked-card__icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: linear-gradient(135deg, #f0a041, #2f2d67);
  color: #fff;
  font-size: 1.2rem;
}

.dashboard-locked-card h3 {
  margin-bottom: 0.65rem;
  color: var(--oa-secondary);
}

.dashboard-locked-card p {
  margin-bottom: 1rem;
  color: rgba(37, 33, 89, 0.66);
}

.dashboard-subscription-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 22px;
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.14);
}

.dashboard-subscription-banner strong {
  display: block;
  color: var(--oa-secondary);
}

.dashboard-subscription-banner p {
  margin: 0.2rem 0 0;
  color: rgba(37, 33, 89, 0.62);
}

.dashboard-subscription-banner--warning {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.2);
}

.ui-activity-row strong {
  display: block;
  color: var(--oa-secondary);
}

.ui-activity-row p {
  font-size: 0.88rem;
}

.billing-checkout-shell,
.billing-pending-shell {
  display: grid;
  gap: 1.2rem;
}

.billing-checkout-shell {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.72fr);
  align-items: start;
}

.billing-checkout-main,
.billing-checkout-side,
.billing-pending-grid {
  display: grid;
  gap: 1.2rem;
}

.billing-plan-hero,
.billing-pending-hero {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.4rem 1.5rem;
  border-radius: 28px;
  border: 1px solid rgba(37, 33, 89, 0.08);
  box-shadow: 0 24px 50px rgba(24, 21, 46, 0.08);
}

.billing-plan-hero {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.66), transparent 28%),
    linear-gradient(135deg, rgba(255,247,236,0.98), rgba(245,248,255,0.96));
}

.billing-pending-hero {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.66), transparent 28%),
    linear-gradient(135deg, rgba(255,246,231,0.98), rgba(244,247,255,0.96));
}

.billing-plan-hero__eyebrow {
  margin: 0 0 0.45rem;
  color: var(--oa-primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.billing-plan-hero h2,
.billing-pending-hero h2 {
  margin: 0 0 0.55rem;
  color: var(--oa-secondary);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.08;
}

.billing-plan-hero p,
.billing-pending-hero p {
  color: var(--app-text-muted);
}

.billing-plan-hero__price,
.billing-pending-hero__badge {
  min-width: 220px;
  padding: 1rem 1.1rem;
  border-radius: 22px;
  border: 1px solid rgba(37, 33, 89, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

.billing-plan-hero__price span,
.billing-pending-hero__badge span,
.billing-gateway-card__head p,
.billing-summary-row span,
.billing-reference-item span {
  display: block;
  color: var(--app-text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.billing-plan-hero__price strong,
.billing-pending-hero__badge strong {
  display: block;
  color: var(--oa-secondary);
  font-size: 1.4rem;
}

.billing-plan-hero__price small,
.billing-pending-hero__badge small {
  color: var(--app-text-muted);
}

.billing-checkout-card,
.billing-summary-card,
.billing-trust-card,
.billing-pending-card {
  overflow: hidden;
}

.billing-gateway-grid,
.billing-pending-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.billing-gateway-card {
  padding: 1.2rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(37, 33, 89, 0.08);
  box-shadow: 0 20px 45px rgba(24, 21, 46, 0.07);
}

.billing-gateway-card--featured {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.78), transparent 30%),
    linear-gradient(135deg, rgba(255,244,227,0.98), rgba(244,247,255,0.98));
  border-color: rgba(244, 157, 54, 0.18);
}

.billing-gateway-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.billing-gateway-card__head h3 {
  margin: 0 0 0.25rem;
  color: var(--oa-secondary);
}

.billing-gateway-card__copy {
  margin-bottom: 0.8rem;
  color: var(--app-text-muted);
}

.billing-step-list,
.billing-trust-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--app-text-muted);
}

.billing-step-list li,
.billing-trust-list li {
  margin-bottom: 0.55rem;
}

.billing-env-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.billing-env-badge--sandbox {
  background: rgba(255, 193, 7, 0.14);
  color: #8b6200;
}

.billing-env-badge--live {
  background: rgba(40, 167, 69, 0.14);
  color: #1f7b35;
}

.billing-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid rgba(37, 33, 89, 0.08);
}

.billing-summary-row strong,
.billing-reference-item strong {
  color: var(--oa-secondary);
  font-size: 1rem;
}

.billing-summary-row--total strong {
  font-size: 1.28rem;
}

.billing-reference-list {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0 1.1rem;
}

.billing-reference-item {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(37, 33, 89, 0.04);
  border: 1px solid rgba(37, 33, 89, 0.08);
}

.billing-action-stack {
  display: grid;
  gap: 0.75rem;
}

.billing-help-note {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(37, 33, 89, 0.05);
  border: 1px solid rgba(37, 33, 89, 0.08);
}

.billing-help-note strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--oa-secondary);
}

.billing-help-note p {
  margin: 0;
  color: var(--app-text-muted);
}

@media (max-width: 1199.98px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .dashboard-main {
    padding-right: 0;
  }

  .dashboard-topbar {
    margin-top: 0.35rem;
  }

  .app-sidenav {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    width: min(84vw, 340px) !important;
    max-width: 340px;
    transform: translateX(100%);
    overflow-y: auto;
    z-index: 1100;
  }

  body.sidebar-open .app-sidenav {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 991.98px) {
  .dashboard-hero,
  .dashboard-topbar .container-fluid {
    border-radius: 24px;
  }

  .dashboard-hero {
    flex-direction: column;
  }

  .dashboard-hero__actions {
    flex-direction: row;
    min-width: 0;
  }

  .ui-stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767.98px) {
  .dashboard-topbar .container-fluid {
    min-height: auto;
    padding: 1rem 1rem 1rem 1.15rem !important;
  }

  .dashboard-topbar__actions {
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .dashboard-user-pill span:last-child {
    display: none;
  }

  .dashboard-hero {
    padding: 1.2rem;
  }

  .dashboard-hero__actions {
    flex-direction: column;
  }

  .dashboard-subscription-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .ui-stat-grid {
    grid-template-columns: 1fr;
  }

  .app-sidenav {
    width: min(88vw, 320px) !important;
    max-width: 320px;
  }

  .dashboard-sidebar__footer {
    margin-bottom: 5rem;
  }

  .dashboard-theme-toggle span {
    display: none;
  }

  .ui-table-shell__body {
    overflow-x: auto;
  }

  .ui-table {
    min-width: 560px;
  }
}

@media (max-width: 480px) {
  .dashboard-topbar .container-fluid {
    padding: 0.9rem !important;
  }

  .dashboard-hero__meta {
    gap: 0.5rem;
  }

  .dashboard-hero__meta span {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Notifications */
.app-toast-stack {
  position: fixed;
  top: 1.15rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  width: min(520px, calc(100vw - 2rem));
  display: grid;
  gap: 0.75rem;
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: start;
  padding: 1rem 1rem 1rem 0.95rem;
  border-radius: 22px;
  border: 1px solid rgba(37, 33, 89, 0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(250,251,255,0.94));
  box-shadow: 0 24px 55px rgba(24, 21, 46, 0.14);
  backdrop-filter: blur(18px);
  animation: appToastIn 0.22s ease;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.app-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.app-toast__icon {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 1rem;
  flex-shrink: 0;
}

.app-toast__content {
  min-width: 0;
}

.app-toast__title {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--oa-secondary);
  font-size: 0.95rem;
}

.app-toast__message {
  margin: 0;
  color: rgba(37, 33, 89, 0.76);
  line-height: 1.45;
}

.app-toast__close {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(37, 33, 89, 0.05);
  color: rgba(37, 33, 89, 0.6);
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .landing-body,
:root[data-theme="dark"] .dashboard-body {
  color: var(--app-text);
}

:root[data-theme="dark"] .dashboard-body {
  background:
    radial-gradient(circle at top left, rgba(244, 157, 54, 0.12), transparent 20%),
    radial-gradient(circle at top right, rgba(103, 80, 164, 0.12), transparent 28%),
    linear-gradient(180deg, #0d1324 0%, #09101d 100%);
}

:root[data-theme="dark"] .ui-card,
:root[data-theme="dark"] .ui-table-shell,
:root[data-theme="dark"] .ui-stat-card,
:root[data-theme="dark"] .dashboard-locked-card,
:root[data-theme="dark"] .app-toast,
:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .dashboard-subscription-banner {
  background: var(--app-surface);
  border-color: var(--app-border);
}

:root[data-theme="dark"] .ui-page-header__title,
:root[data-theme="dark"] .ui-card__title,
:root[data-theme="dark"] .dashboard-sidebar__brand-title,
:root[data-theme="dark"] .ui-stat-card h2,
:root[data-theme="dark"] .ui-activity-row strong,
:root[data-theme="dark"] .app-toast__title,
:root[data-theme="dark"] .ui-field__label {
  color: var(--app-text);
}

:root[data-theme="dark"] .ui-page-header__subtitle,
:root[data-theme="dark"] .ui-card__subtitle,
:root[data-theme="dark"] .ui-empty-copy,
:root[data-theme="dark"] .ui-field__help,
:root[data-theme="dark"] .ui-table th,
:root[data-theme="dark"] .ui-table td,
:root[data-theme="dark"] .app-toast__message,
:root[data-theme="dark"] .dashboard-sidebar__brand-subtitle,
:root[data-theme="dark"] .dashboard-sidebar__section-label,
:root[data-theme="dark"] .dashboard-sidebar__footer,
:root[data-theme="dark"] .dashboard-subscription-chip span,
:root[data-theme="dark"] .dashboard-subscription-banner p {
  color: var(--app-text-muted);
}

:root[data-theme="dark"] .ui-input,
:root[data-theme="dark"] .auth-form-grid .ui-input {
  background: rgba(10, 16, 31, 0.88);
  color: var(--app-text);
  border-color: var(--app-border);
}

:root[data-theme="dark"] .dashboard-topbar .container-fluid {
  background: linear-gradient(135deg, #cf8231 0%, #57456f 46%, #171f3f 100%);
}

:root[data-theme="dark"] .app-sidenav .nav-link.active,
:root[data-theme="dark"] .dashboard-sidebar__brand-icon,
:root[data-theme="dark"] .dashboard-locked-card__icon {
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .dashboard-hero,
:root[data-theme="dark"] .dashboard-subscription-chip,
:root[data-theme="dark"] .app-sidenav .nav-link:hover,
:root[data-theme="dark"] .dashboard-hero__meta span,
:root[data-theme="dark"] .dashboard-sidebar__nav-icon,
:root[data-theme="dark"] .ui-button--secondary,
:root[data-theme="dark"] .ui-button--ghost,
:root[data-theme="dark"] .ui-status-pill,
:root[data-theme="dark"] .app-toast__close {
  background: rgba(244, 157, 54, 0.08);
}

:root[data-theme="dark"] .preop-hero,
:root[data-theme="dark"] .postop-hero,
:root[data-theme="dark"] .summary-hero,
:root[data-theme="dark"] .billing-plan-hero,
:root[data-theme="dark"] .billing-pending-hero,
:root[data-theme="dark"] .preop-summary-card,
:root[data-theme="dark"] .summary-highlight-card,
:root[data-theme="dark"] .billing-gateway-card,
:root[data-theme="dark"] .billing-reference-item,
:root[data-theme="dark"] .billing-help-note,
:root[data-theme="dark"] .billing-plan-hero__price,
:root[data-theme="dark"] .billing-pending-hero__badge {
  background: var(--app-surface);
  border-color: var(--app-border);
}

:root[data-theme="dark"] .preop-hero__badge,
:root[data-theme="dark"] .postop-hero__stats,
:root[data-theme="dark"] .summary-hero__metrics,
:root[data-theme="dark"] .billing-gateway-card--featured {
  background: rgba(244, 157, 54, 0.08);
  border-color: var(--app-border);
}

:root[data-theme="dark"] .preop-hero__meta span,
:root[data-theme="dark"] .summary-hero__chips span,
:root[data-theme="dark"] .preop-checklist__item {
  color: var(--app-text-muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--app-border);
}

:root[data-theme="dark"] .billing-step-list,
:root[data-theme="dark"] .billing-trust-list,
:root[data-theme="dark"] .billing-gateway-card__copy,
:root[data-theme="dark"] .billing-summary-row span,
:root[data-theme="dark"] .billing-reference-item span,
:root[data-theme="dark"] .billing-plan-hero__price small,
:root[data-theme="dark"] .billing-pending-hero__badge small,
:root[data-theme="dark"] .billing-help-note p {
  color: var(--app-text-muted);
}

:root[data-theme="dark"] .billing-plan-hero h2,
:root[data-theme="dark"] .billing-pending-hero h2,
:root[data-theme="dark"] .billing-gateway-card__head h3,
:root[data-theme="dark"] .billing-summary-row strong,
:root[data-theme="dark"] .billing-reference-item strong,
:root[data-theme="dark"] .billing-help-note strong {
  color: var(--app-text);
}

.app-toast--success .app-toast__icon {
  background: rgba(40, 167, 69, 0.14);
  color: #1f7b35;
}

.app-toast--error .app-toast__icon,
.app-toast--danger .app-toast__icon {
  background: rgba(220, 53, 69, 0.14);
  color: #aa2434;
}

.app-toast--warning .app-toast__icon {
  background: rgba(255, 193, 7, 0.18);
  color: #8b6200;
}

.app-toast--info .app-toast__icon {
  background: rgba(37, 33, 89, 0.1);
  color: var(--oa-secondary);
}

@keyframes appToastIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 767.98px) {
  .app-toast-stack {
    top: 0.8rem;
    width: calc(100vw - 1rem);
  }

  .app-toast {
    border-radius: 18px;
    padding: 0.9rem;
  }
}

/* ADRS workflow sheets */
.preop-sticky-summary {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.preop-hero,
.postop-hero,
.summary-hero {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1rem;
  padding: 1.4rem 1.5rem;
  border-radius: 28px;
  border: 1px solid rgba(37, 33, 89, 0.08);
  box-shadow: 0 24px 50px rgba(24, 21, 46, 0.08);
}

.preop-hero {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.68), transparent 28%),
    linear-gradient(135deg, rgba(255,247,236,0.98), rgba(245,248,255,0.96));
}

.postop-hero {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.62), transparent 28%),
    linear-gradient(135deg, rgba(238,249,244,0.98), rgba(244,247,255,0.96));
}

.summary-hero {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.62), transparent 28%),
    linear-gradient(135deg, rgba(245,244,255,0.98), rgba(255,249,241,0.96));
}

.preop-hero__content,
.postop-hero__content,
.summary-hero__main {
  max-width: 760px;
}

.preop-hero__eyebrow,
.postop-hero__eyebrow,
.summary-hero__eyebrow {
  margin: 0 0 0.5rem;
  color: var(--oa-primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.preop-hero h2,
.postop-hero h2,
.summary-hero h2 {
  margin: 0 0 0.55rem;
  color: var(--oa-secondary);
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  line-height: 1.08;
}

.preop-hero p,
.postop-hero p,
.summary-hero p {
  color: var(--app-text-muted);
}

.preop-hero__meta,
.summary-hero__chips,
.ot-command-strip__shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.preop-hero__meta span,
.summary-hero__chips span,
.ot-command-strip__shortcuts span {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(37, 33, 89, 0.06);
  color: var(--app-text-muted);
  font-weight: 700;
  font-size: 0.88rem;
}

.preop-hero__badge,
.postop-hero__stats,
.summary-hero__metrics {
  min-width: 220px;
  padding: 1rem 1.1rem;
  border-radius: 22px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(37, 33, 89, 0.08);
}

.preop-hero__badge {
  display: grid;
  align-content: center;
  background: linear-gradient(135deg, rgba(244,157,54,0.16), rgba(37,33,89,0.08));
}

.preop-hero__badge span,
.postop-hero__stats span,
.summary-hero__metrics span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--app-text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preop-hero__badge strong,
.postop-hero__stats strong,
.summary-hero__metrics strong {
  color: var(--oa-secondary);
  font-size: 1.05rem;
}

.postop-hero__stats,
.summary-hero__metrics {
  display: grid;
  gap: 0.8rem;
}

.preop-summary-card {
  padding: 1rem 1.1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(37, 33, 89, 0.08);
  box-shadow: 0 18px 38px rgba(24, 21, 46, 0.08);
}

.preop-summary-card--highlight {
  background: linear-gradient(135deg, rgba(244,157,54,0.16), rgba(255,255,255,0.98));
}

.preop-summary-card span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--app-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preop-summary-card small {
  display: block;
  margin-top: 0.4rem;
  color: var(--app-text-muted);
}

.preop-sheet,
.preop-sheet__section {
  display: grid;
  gap: 1rem;
}

.preop-grid {
  display: grid;
  gap: 1rem;
}

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

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

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

.preop-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.preop-toggle-grid .ui-field {
  min-width: 160px;
}

.preop-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.preop-checklist__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 52px;
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  background: rgba(37, 33, 89, 0.04);
  border: 1px solid rgba(37, 33, 89, 0.08);
}

.preop-sheet__actions {
  display: flex;
  justify-content: flex-end;
}

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

.summary-highlight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.summary-highlight-card {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(37, 33, 89, 0.04);
  border: 1px solid rgba(37, 33, 89, 0.08);
}

.summary-highlight-card span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--app-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-highlight-card strong {
  color: var(--oa-secondary);
  font-size: 1.15rem;
}

.summary-share-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.ot-command-strip {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ot-command-strip__label span,
.ot-chart-panel__badge span {
  display: block;
  color: var(--ot-muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ot-command-strip__label strong,
.ot-chart-panel__badge strong {
  color: #fff;
}

.ot-chart-panel__badge {
  min-width: 132px;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ot-reminder-pill {
  min-width: 160px;
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.ot-reminder-pill span {
  display: block;
  color: rgba(255,255,255,0.68);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ot-reminder-pill strong {
  display: block;
  font-size: 1rem;
}

.ot-reminder-pill--overdue {
  background: rgba(220, 53, 69, 0.16);
  border: 1px solid rgba(220, 53, 69, 0.35);
}

.case-live-shell {
  display: grid;
  gap: 1.25rem;
}

.ot-workspace-shell {
  display: grid;
  gap: 1.5rem;
}

.ot-workspace-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 24px;
  background: rgba(10, 14, 28, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.12);
  position: sticky;
  top: 1rem;
  z-index: 20;
  backdrop-filter: blur(18px);
}

.ot-workspace-header__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ot-workspace-badge {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #67e8f9;
  background: rgba(8, 47, 73, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.ot-workspace-header__copy h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 1.05rem;
}

.ot-workspace-header__copy p {
  margin: 0.2rem 0 0;
  color: #94a3b8;
  font-size: 0.78rem;
}

.ot-workspace-alert {
  border: 0;
  background: transparent;
  color: #fbbf24;
  font-weight: 700;
}

.ot-workspace-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem;
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.12);
  overflow-x: auto;
}

.ot-workspace-nav__button {
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  border-radius: 14px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.ot-workspace-nav__button:hover,
.ot-workspace-nav__button.is-active {
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.12);
}

.ot-workspace-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ot-workspace-clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #67e8f9;
  background: rgba(8, 47, 73, 0.36);
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.18);
}

.ot-workspace-action {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  padding: 0.78rem 1rem;
  font-weight: 700;
}

.ot-workspace-action--ghost {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.72);
}

.ot-workspace-action--primary {
  color: #fff;
  background: linear-gradient(135deg, #059669, #14b8a6);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.22);
}

.ot-workspace-main {
  display: grid;
  gap: 1.5rem;
}

.ot-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 1.5rem;
}

.ot-workspace-column,
.ot-workspace-timeline,
.ot-secondary-panel,
.ot-setup-stack {
  display: grid;
  gap: 1rem;
}

.ot-panel--accent-green {
  border-left: 3px solid #10b981;
}

.ot-panel--accent-purple {
  border-left: 3px solid #a855f7;
}

.ot-vital-entry-grid,
.ot-drug-entry-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ot-vital-entry-grid--secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ot-vital-entry-grid label,
.ot-drug-entry-grid label,
.ot-setup-card label {
  display: block;
  margin-bottom: 0.35rem;
  color: #94a3b8;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ot-vital-entry-grid__wide,
.ot-drug-entry-grid__wide {
  grid-column: span 2;
}

.ot-inline-actions,
.ot-inline-select-row {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ot-inline-form {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.ot-inline-form.is-open {
  display: block;
}

.ot-secondary-panel {
  max-width: 56rem;
  margin: 0 auto;
  width: 100%;
  padding: 1.75rem;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.ot-secondary-panel h2 {
  margin: 0 0 0.5rem;
  color: #f8fafc;
}

.ot-secondary-panel p {
  margin: 0 0 1rem;
  color: #94a3b8;
}

.ot-setup-card,
.ot-review-card {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.ot-review-card p {
  margin: 0 0 0.6rem;
}

.ot-review-card__ok {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.24);
  color: #6ee7b7;
}

.case-live-hero {
  display: grid;
  gap: 1rem;
}

.case-live-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.case-live-nav__button {
  border: 1px solid rgba(37, 33, 89, 0.1);
  background: rgba(255, 255, 255, 0.86);
  color: var(--oa-secondary);
  border-radius: 999px;
  padding: 0.72rem 1rem;
  font-weight: 700;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.case-live-nav__button:hover,
.case-live-nav__button.is-active {
  background: linear-gradient(135deg, rgba(37, 33, 89, 0.96), rgba(244, 157, 54, 0.9));
  color: #fff;
  transform: translateY(-1px);
}

.case-live-section {
  display: none;
  gap: 1rem;
}

.case-live-section.is-active {
  display: grid;
}

.case-live-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.case-live-shortcuts,
.case-live-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.case-flow-grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.case-flow-grid--compact {
  gap: 0.75rem;
}

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

  .ot-workspace-grid {
    grid-template-columns: 1fr;
  }

  .case-flow-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ot-vital-entry-grid,
  .ot-drug-entry-grid,
  .ot-vital-entry-grid--secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .case-flow-grid--5 {
    grid-template-columns: 1fr;
  }

  .ot-vital-entry-grid,
  .ot-drug-entry-grid,
  .ot-vital-entry-grid--secondary {
    grid-template-columns: 1fr;
  }

  .ot-vital-entry-grid__wide,
  .ot-drug-entry-grid__wide {
    grid-column: span 1;
  }
}

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

.ot-quick-grid--timeline small {
  display: block;
  margin-top: 0.35rem;
  color: var(--ot-muted);
}

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

.ot-shortcut-pill {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(244, 157, 54, 0.16);
  color: #ffd9ab;
  font-weight: 700;
}

.ot-fluid-totals {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.ot-fluid-totals div span {
  display: block;
  color: var(--ot-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ot-fluid-warning,
.ot-drug-suggestion {
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(244, 157, 54, 0.14);
  color: #ffd9ab;
}

.ot-toast--error {
  background: rgba(220, 53, 69, 0.18);
  border-color: rgba(220, 53, 69, 0.24);
  color: #ffb5bc;
}

@media (max-width: 1199.98px) {
  .billing-checkout-shell,
  .billing-pending-grid {
    grid-template-columns: 1fr;
  }

  .billing-plan-hero,
  .billing-pending-hero {
    flex-direction: column;
  }

  .preop-hero,
  .postop-hero,
  .summary-hero {
    flex-direction: column;
  }

  .preop-sticky-summary,
  .preop-grid--4,
  .summary-highlight-grid,
  .ot-quick-grid--timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .billing-gateway-grid,
  .billing-pending-grid {
    grid-template-columns: 1fr;
  }

  .billing-gateway-card__head,
  .billing-summary-row {
    flex-direction: column;
  }

  .billing-plan-hero__price,
  .billing-pending-hero__badge {
    min-width: 0;
  }

  .preop-hero__badge,
  .postop-hero__stats,
  .summary-hero__metrics {
    min-width: 0;
  }

  .preop-sticky-summary,
  .preop-grid--2,
  .preop-grid--3,
  .preop-grid--4,
  .ui-report-columns,
  .summary-highlight-grid,
  .ot-event-grid,
  .ot-quick-grid--timeline {
    grid-template-columns: 1fr;
  }

  .summary-share-field,
  .ot-command-strip {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}
.case-flow-shell {
  position: relative;
}

.case-flow-panel {
  background: linear-gradient(145deg, rgba(12, 28, 51, 0.05), rgba(15, 118, 110, 0.08));
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 1.25rem 2.5rem rgba(15, 23, 42, 0.08);
}

.case-flow-panel--animated {
  animation: caseFlowFade 220ms ease;
}

.case-flow-canvas {
  min-height: 480px;
}

.case-flow-context {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.case-flow-context__badge {
  min-width: 12rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.case-flow-context__badge span,
.case-flow-summary span {
  display: block;
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.case-flow-context__badge strong,
.case-flow-summary strong {
  color: #0f172a;
  font-size: 1rem;
}

.case-flow-section {
  display: grid;
  gap: 1.25rem;
}

.case-flow-section__intro {
  max-width: 52rem;
}

.case-flow-section__eyebrow {
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.case-flow-section__title {
  font-size: 1.7rem;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.case-flow-section__copy {
  color: #475569;
  margin-bottom: 0;
}

.case-flow-grid {
  display: grid;
  gap: 1rem;
}

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

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

.case-flow-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.case-flow-card {
  padding: 1.25rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 1rem;
}

.case-flow-card--theatre {
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 35%),
    linear-gradient(145deg, rgba(12, 28, 51, 0.98), rgba(15, 118, 110, 0.92));
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.28);
}

.case-flow-card--theatre .case-flow-card__header h3,
.case-flow-card--theatre .case-flow-summary strong,
.case-flow-card--theatre .ui-field__label {
  color: #f8fafc;
}

.case-flow-card--theatre .case-flow-card__header p,
.case-flow-card--theatre .case-flow-summary span,
.case-flow-card--theatre .ui-field__help {
  color: rgba(248, 250, 252, 0.72);
}

.case-flow-theatre-pulse {
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.case-flow-theatre-pulse span {
  display: block;
  color: rgba(248, 250, 252, 0.68);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.case-flow-theatre-pulse strong {
  color: #f8fafc;
}

.case-flow-card__header,
.case-flow-repeater__header,
.case-flow-nav,
.case-flow-modal__header,
.case-flow-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.case-flow-card__header h3,
.case-flow-repeater__header h3 {
  margin-bottom: 0.15rem;
  color: #0f172a;
}

.case-flow-card__header p,
.case-flow-repeater__header p {
  margin-bottom: 0;
  color: #64748b;
}

.case-flow-patient-list,
.case-flow-summary,
.case-flow-repeater__list {
  display: grid;
  gap: 0.75rem;
}

.case-flow-patient-card,
.case-flow-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: #fff;
}

.case-flow-patient-card input {
  margin-right: 0.75rem;
}

.case-flow-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.case-flow-chip {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-weight: 600;
}

.case-flow-repeater__editor {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.case-flow-repeater__editor--monitoring {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

.case-flow-table-wrap {
  overflow-x: auto;
}

.case-flow-nav {
  margin-top: 1.5rem;
}

.case-flow-nav__next[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.ot-primary-button--mini {
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.case-flow-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.case-flow-note {
  margin-bottom: 0;
  color: #475569;
}

.case-flow-modal-host:empty {
  display: none;
}

.case-flow-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 1rem;
}

.case-flow-modal__dialog {
  width: min(100%, 38rem);
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 1.25rem 2.5rem rgba(15, 23, 42, 0.24);
}

.case-flow-modal__header,
.case-flow-modal__body {
  padding: 1.25rem;
}

.case-flow-modal__body {
  display: grid;
  gap: 1rem;
}

.case-flow-modal__close,
.case-flow-pill button,
.case-flow-table-wrap button {
  border: 0;
  background: transparent;
  color: #ef4444;
  font-size: 1.1rem;
}

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

@media (max-width: 991px) {
  .case-flow-grid--2,
  .case-flow-grid--3,
  .case-flow-grid--4,
  .case-flow-repeater__editor,
  .case-flow-repeater__editor--monitoring,
  .case-flow-summary {
    grid-template-columns: 1fr;
  }

  .case-flow-nav {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .case-flow-nav .ui-button {
    width: 100%;
  }
}

.case-flow-shell--ot {
  margin: -1rem -1.5rem -1rem;
  width: calc(100% + 3rem);
}

.case-flow-page {
  margin: 0;
  background: #08111f;
  overflow-x: hidden;
}

.case-flow-page .case-flow-shell--ot {
  margin: 0;
  width: 100%;
}

.case-flow-shell--ot .case-flow-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #050816;
  box-shadow: none;
}

.case-flow-shell--ot .case-flow-form {
  margin: 0;
}

.case-flow-shell--ot .ot-workspace-shell {
  min-height: calc(100vh - 4.5rem);
  background:
    radial-gradient(circle at top center, rgba(36, 75, 135, 0.2), transparent 32%),
    linear-gradient(180deg, #070b1c 0%, #050816 100%);
  color: #d7e4ff;
}

.case-flow-shell--ot .ot-workspace-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.15rem 2.4rem;
  background: rgba(22, 28, 49, 0.96);
  border-bottom: 1px solid rgba(110, 129, 178, 0.16);
  backdrop-filter: blur(18px);
}

.case-flow-shell--ot .ot-workspace-header__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.case-flow-shell--ot .ot-workspace-badge {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 0.9rem;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.32);
  color: #3fd8ff;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.case-flow-shell--ot .ot-workspace-header__copy {
  min-width: 0;
  padding-left: 1rem;
  border-left: 1px solid rgba(110, 129, 178, 0.22);
}

.case-flow-shell--ot .ot-workspace-header__copy h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #f4f8ff;
}

.case-flow-shell--ot .ot-workspace-header__copy p {
  margin: 0.15rem 0 0;
  color: #7f92b9;
  font-size: 0.82rem;
}

.case-flow-shell--ot .ot-workspace-alert {
  border: 0;
  background: transparent;
  color: #f3a11f;
  font-weight: 700;
  text-align: left;
  padding: 0;
}

.case-flow-shell--ot .ot-workspace-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(110, 129, 178, 0.16);
  background: rgba(8, 12, 28, 0.9);
  overflow-x: auto;
}

.case-flow-shell--ot .ot-workspace-nav__button {
  border: 1px solid transparent;
  background: transparent;
  color: #a8b7d8;
  padding: 0.82rem 1.15rem;
  border-radius: 0.95rem;
  font-weight: 700;
  min-width: 6rem;
  transition: all 180ms ease;
}

.case-flow-shell--ot .ot-workspace-nav__button.is-active,
.case-flow-shell--ot .ot-workspace-nav__button:hover {
  color: #2ee6ff;
  border-color: rgba(46, 230, 255, 0.4);
  background: rgba(17, 34, 63, 0.95);
  box-shadow: inset 0 0 0 1px rgba(46, 230, 255, 0.12), 0 0 0.9rem rgba(23, 161, 196, 0.15);
}

.case-flow-shell--ot .ot-workspace-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.case-flow-shell--ot .ot-workspace-clock {
  display: inline-flex;
  min-width: 5.8rem;
  justify-content: center;
  padding: 0.9rem 0.8rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(39, 196, 237, 0.24);
  background: rgba(9, 33, 56, 0.74);
  color: #59e6ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

.case-flow-shell--ot .ot-workspace-action {
  border: 1px solid transparent;
  border-radius: 0.8rem;
  padding: 0.85rem 1.2rem;
  font-weight: 800;
}

.case-flow-shell--ot .ot-workspace-action--ghost {
  background: #263149;
  color: #eef4ff;
}

.case-flow-shell--ot .ot-workspace-action--primary {
  background: linear-gradient(135deg, #0fcaaf, #21b48f);
  color: #f8fffd;
  box-shadow: 0 0.75rem 1.5rem rgba(13, 186, 149, 0.18);
}

.case-flow-shell--ot .ot-workspace-main {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 1.6rem 1.4rem 2.5rem;
}

.case-live-section[hidden],
.case-flow-shell--ot .case-live-section {
  display: none;
}

.case-flow-shell--ot .case-live-section.is-active {
  display: block;
}

.case-flow-shell--ot .case-live-section.is-active[hidden] {
  display: none;
}

.case-flow-shell--ot .ot-chart-panel,
.case-flow-shell--ot .ot-panel,
.case-flow-shell--ot .ot-secondary-panel {
  background: #161d31;
  border: 1px solid rgba(93, 111, 155, 0.22);
  border-radius: 1.35rem;
  box-shadow: none;
}

.case-flow-shell--ot .ot-live-shell {
  display: grid;
  gap: 1.4rem;
}

.case-flow-shell--ot .ot-chart-panel {
  padding: 1.2rem 1.2rem 1.35rem;
  border-left: 4px solid #22d3ee;
}

.case-flow-shell--ot .ot-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.case-flow-shell--ot .ot-panel__title {
  margin: 0;
  color: #e9f2ff;
  font-size: 1.08rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.case-flow-shell--ot .ot-panel__subtitle {
  margin: 0.18rem 0 0;
  color: #7285aa;
  font-size: 0.84rem;
}

.case-flow-shell--ot .ot-chart-frame {
  padding: 1rem;
  border-radius: 1rem;
  background: #070c1e;
  border: 1px solid rgba(93, 111, 155, 0.18);
}

.case-flow-shell--ot .ot-chart-frame__inner {
  min-height: 11.5rem;
}

.case-flow-shell--ot .ot-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 1.4rem;
  align-items: start;
}

.case-flow-shell--ot .ot-workspace-column {
  display: grid;
  gap: 1.4rem;
}

.case-flow-shell--ot .ot-panel {
  padding: 1.15rem 1.2rem;
}

.case-flow-shell--ot .ot-panel--accent-green {
  border-left: 4px solid #22d68f;
}

.case-flow-shell--ot .ot-panel--accent-purple {
  border-left: 4px solid #b369ff;
}

.case-flow-shell--ot .ot-vital-entry-grid,
.case-flow-shell--ot .ot-drug-entry-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0.9rem;
}

.case-flow-shell--ot .ot-vital-entry-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.case-flow-shell--ot .ot-vital-entry-grid--secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.case-flow-shell--ot .ot-vital-entry-grid__wide,
.case-flow-shell--ot .ot-drug-entry-grid__wide {
  grid-column: span 2;
}

.case-flow-shell--ot .ot-vital-entry-grid label,
.case-flow-shell--ot .ot-drug-entry-grid label {
  display: block;
  margin-bottom: 0.4rem;
  color: #7083a8;
  font-size: 0.78rem;
}

.case-flow-shell--ot .ot-table-input,
.case-flow-shell--ot .ui-input,
.case-flow-shell--ot select,
.case-flow-shell--ot textarea {
  width: 100%;
  border-radius: 0.8rem;
  border: 1px solid rgba(97, 113, 149, 0.28);
  background: #070c1e;
  color: #edf4ff;
  padding: 0.82rem 0.9rem;
}

.case-flow-shell--ot .ot-table-input::placeholder,
.case-flow-shell--ot .ui-input::placeholder,
.case-flow-shell--ot textarea::placeholder {
  color: #51617f;
}

.case-flow-shell--ot .ot-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.2rem;
}

.case-flow-shell--ot .ot-quick-button {
  border: 1px solid rgba(89, 106, 145, 0.26);
  border-radius: 0.8rem;
  background: #0d1427;
  color: #b6c5e6;
  padding: 0.7rem 0.95rem;
  font-weight: 700;
}

.case-flow-shell--ot .ot-quick-button--ghost {
  background: #121d35;
}

.case-flow-shell--ot .ot-panel--timeline {
  min-height: 100%;
  padding: 0;
  overflow: hidden;
}

.case-flow-shell--ot .ot-panel--timeline .ot-panel__header {
  padding: 1rem 1.15rem;
  margin: 0;
  border-bottom: 1px solid rgba(93, 111, 155, 0.16);
}

.case-flow-shell--ot .ot-timeline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  background: #27324b;
  color: #aab9d7;
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
}

.case-flow-shell--ot .ot-inline-warning {
  margin: 0.95rem 1.15rem 0;
  border-radius: 0.8rem;
  background: rgba(239, 156, 36, 0.12);
  border: 1px solid rgba(239, 156, 36, 0.2);
  color: #ffca72;
  padding: 0.72rem 0.9rem;
  font-size: 0.88rem;
}

.case-flow-shell--ot .ot-timeline-list {
  display: grid;
  gap: 0.8rem;
  padding: 1.15rem;
  max-height: 38rem;
  overflow-y: auto;
}

.case-flow-shell--ot .ot-timeline-row {
  display: grid;
  grid-template-columns: 4rem 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
}

.case-flow-shell--ot .ot-timeline-time {
  color: #7588af;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  text-align: right;
}

.case-flow-shell--ot .ot-timeline-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-flow-shell--ot .ot-timeline-marker::before {
  content: "";
  position: absolute;
  width: 1px;
  top: -1rem;
  bottom: -1rem;
  background: rgba(93, 111, 155, 0.2);
}

.case-flow-shell--ot .ot-timeline-row:first-child .ot-timeline-marker::before {
  top: 50%;
}

.case-flow-shell--ot .ot-timeline-row:last-child .ot-timeline-marker::before {
  bottom: 50%;
}

.case-flow-shell--ot .ot-timeline-marker span {
  position: relative;
  z-index: 1;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(97, 113, 149, 0.3);
  background: #10172a;
}

.case-flow-shell--ot .ot-timeline-row--vital .ot-timeline-marker span {
  border-color: rgba(34, 214, 143, 0.45);
  box-shadow: inset 0 0 0 0.3rem rgba(34, 214, 143, 0.18);
}

.case-flow-shell--ot .ot-timeline-row--drug .ot-timeline-marker span {
  border-color: rgba(179, 105, 255, 0.5);
  box-shadow: inset 0 0 0 0.3rem rgba(179, 105, 255, 0.18);
}

.case-flow-shell--ot .ot-timeline-card {
  border-radius: 0.95rem;
  border: 1px solid rgba(93, 111, 155, 0.18);
  background: #070c1e;
  padding: 1rem 1.1rem;
}

.case-flow-shell--ot .ot-timeline-vitals,
.case-flow-shell--ot .ot-timeline-drug {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
}

.case-flow-shell--ot .ot-timeline-vitals span,
.case-flow-shell--ot .ot-timeline-drug span {
  color: #90a4cd;
}

.case-flow-shell--ot .ot-timeline-vitals strong {
  color: #f3fbff;
  margin-left: 0.3rem;
}

.case-flow-shell--ot .ot-timeline-row--vital .ot-timeline-vitals strong:nth-of-type(1),
.case-flow-shell--ot .ot-timeline-row--vital .ot-timeline-vitals span:first-child strong {
  color: #31de95;
}

.case-flow-shell--ot .ot-timeline-row--drug .ot-timeline-drug strong {
  color: #d3a9ff;
  font-size: 1rem;
}

.case-flow-shell--ot .ot-timeline-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0 1.15rem 1.15rem;
}

.case-flow-shell--ot .ot-mini-vital {
  border-radius: 0.9rem;
  border: 1px solid rgba(93, 111, 155, 0.18);
  background: #0e1427;
  padding: 0.8rem 0.9rem;
}

.case-flow-shell--ot .ot-mini-vital span {
  display: block;
  color: #6f82a8;
  font-size: 0.76rem;
  margin-bottom: 0.25rem;
}

.case-flow-shell--ot .ot-mini-vital strong {
  color: #edf4ff;
  font-size: 0.95rem;
}

.case-flow-shell--ot .ot-mini-vital--critical strong {
  color: #ff8f9a;
}

.case-flow-shell--ot .ot-mini-vital--warning strong {
  color: #ffd06d;
}

.case-flow-shell--ot .ot-empty-state--timeline {
  min-height: 16rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: #0b1021;
  border: 1px dashed rgba(93, 111, 155, 0.24);
  color: #66789f;
}

.case-flow-shell--ot .ot-secondary-panel {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.45rem;
}

.case-flow-shell--ot .ot-secondary-panel h2 {
  color: #eef4ff;
  margin-bottom: 0.35rem;
}

.case-flow-shell--ot .ot-secondary-panel p {
  color: #7a8cb3;
}

.case-flow-shell--ot .ot-setup-stack {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.case-flow-shell--ot .ot-setup-card {
  padding: 1.15rem;
  border-radius: 1rem;
  border: 1px solid rgba(93, 111, 155, 0.18);
  background: #0a1122;
}

.case-flow-shell--ot .ot-setup-card > label {
  display: block;
  margin-bottom: 0.75rem;
  color: #dce8ff;
  font-weight: 700;
}

.case-flow-shell--ot .ot-inline-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
}

.case-flow-shell--ot .ot-inline-form {
  display: none;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(93, 111, 155, 0.14);
}

.case-flow-shell--ot .ot-inline-form.is-open {
  display: grid;
}

.case-flow-shell--ot .ot-review-card {
  display: grid;
  gap: 0.85rem;
  padding: 1.15rem;
  border-radius: 1rem;
  border: 1px solid rgba(93, 111, 155, 0.18);
  background: #0a1122;
  margin-bottom: 1rem;
}

.case-flow-shell--ot .ot-review-card p {
  margin: 0;
  color: #c9d6f0;
}

.case-flow-shell--ot .ot-review-card strong {
  color: #eff5ff;
}

.case-flow-shell--ot .ot-review-card__ok {
  border-radius: 0.85rem;
  background: rgba(34, 214, 143, 0.12);
  border: 1px solid rgba(34, 214, 143, 0.2);
  padding: 0.8rem 0.9rem;
}

@media (max-width: 1199.98px) {
  .case-flow-shell--ot .ot-workspace-header {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .case-flow-shell--ot .ot-workspace-nav {
    justify-content: flex-start;
  }

  .case-flow-shell--ot .ot-workspace-actions {
    justify-content: flex-end;
  }

  .case-flow-shell--ot .ot-workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .case-flow-shell--ot {
    margin: -1rem -1rem -1rem;
    width: calc(100% + 2rem);
  }

  .case-flow-shell--ot .ot-workspace-header {
    padding: 1rem;
  }

  .case-flow-shell--ot .ot-workspace-main {
    padding: 1rem;
  }

  .case-flow-shell--ot .ot-vital-entry-grid,
  .case-flow-shell--ot .ot-vital-entry-grid--secondary,
  .case-flow-shell--ot .ot-drug-entry-grid,
  .case-flow-shell--ot .ot-inline-select-row,
  .case-flow-shell--ot .ot-timeline-footer {
    grid-template-columns: 1fr;
  }

  .case-flow-shell--ot .ot-vital-entry-grid__wide,
  .case-flow-shell--ot .ot-drug-entry-grid__wide {
    grid-column: span 1;
  }

  .case-flow-shell--ot .ot-timeline-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .case-flow-shell--ot .ot-timeline-time {
    text-align: left;
  }

  .case-flow-shell--ot .ot-timeline-marker {
    display: none;
  }
}

.case-flow-shell--ot {
  --oa-bg: #08111f;
  --oa-surface: rgba(11, 19, 36, 0.94);
  --oa-surface-strong: #101a2e;
  --oa-ink: #e6f0ff;
  --oa-muted: #8ea4c8;
  --oa-line: rgba(107, 134, 177, 0.2);
  --oa-brand: #4da3ff;
  --oa-brand-soft: rgba(77, 163, 255, 0.12);
  --oa-teal: #18c7b7;
  --oa-violet: #a578ff;
  --oa-amber: #ffb44d;
  --oa-danger: #ff6b7d;
}

.case-flow-shell--ot .ot-workspace-shell {
  position: relative;
  min-height: calc(100vh - 4.5rem);
  background:
    radial-gradient(circle at top left, rgba(77, 163, 255, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(24, 199, 183, 0.14), transparent 22%),
    linear-gradient(180deg, #09111f 0%, #07101d 100%);
  color: var(--oa-ink);
}

.case-flow-shell--ot .ot-workspace-header {
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(9, 16, 29, 0.88);
  border-bottom: 1px solid rgba(107, 134, 177, 0.18);
  backdrop-filter: blur(20px);
}

.case-flow-shell--ot .ot-workspace-badge {
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.14), rgba(24, 199, 183, 0.14));
  color: var(--oa-brand);
  border-color: rgba(77, 163, 255, 0.24);
}

.case-flow-shell--ot .ot-workspace-header__copy {
  border-left-color: rgba(107, 134, 177, 0.2);
}

.case-flow-shell--ot .ot-workspace-header__copy h2 {
  color: var(--oa-ink);
  font-size: 1rem;
}

.case-flow-shell--ot .ot-workspace-header__copy p,
.case-flow-shell--ot .ot-workspace-alert {
  color: var(--oa-amber);
}

.case-flow-shell--ot .ot-workspace-nav {
  justify-content: center;
  gap: 0.45rem;
  padding: 0.4rem;
  background: rgba(13, 22, 41, 0.9);
  border-color: rgba(107, 134, 177, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.case-flow-shell--ot .ot-workspace-nav__button {
  min-width: auto;
  color: var(--oa-muted);
  padding: 0.78rem 1.05rem;
  font-size: 0.92rem;
}

.case-flow-shell--ot .ot-workspace-nav__button.is-active,
.case-flow-shell--ot .ot-workspace-nav__button:hover {
  color: var(--oa-brand);
  background: rgba(77, 163, 255, 0.09);
  border-color: rgba(77, 163, 255, 0.24);
  box-shadow: 0 12px 28px rgba(17, 31, 58, 0.28);
}

.case-flow-shell--ot .ot-workspace-clock {
  background: rgba(13, 24, 43, 0.92);
  color: var(--oa-brand);
  border-color: rgba(77, 163, 255, 0.2);
}

.case-flow-shell--ot .ot-workspace-action {
  font-size: 0.9rem;
}

.case-flow-shell--ot .ot-workspace-action--ghost {
  background: rgba(14, 25, 46, 0.94);
  color: var(--oa-ink);
  border-color: rgba(107, 134, 177, 0.22);
}

.case-flow-shell--ot .ot-workspace-action--primary {
  background: linear-gradient(135deg, #2f8cff, #18c7b7);
  box-shadow: 0 16px 32px rgba(20, 58, 112, 0.3);
}

.case-flow-shell--ot .ot-workspace-main {
  position: relative;
  width: min(100%, 1320px);
  padding: 1.35rem 1.35rem 2rem;
  overflow: visible;
}

.case-flow-shell--ot .case-live-section--main {
  display: block;
}

.case-flow-shell--ot .ot-vitals-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.case-flow-shell--ot .ot-vitals-strip__card {
  background: rgba(12, 21, 38, 0.88);
  border: 1px solid rgba(107, 134, 177, 0.16);
  border-radius: 1rem;
  padding: 0.95rem 1rem;
  box-shadow: 0 14px 30px rgba(2, 8, 20, 0.28);
}

.case-flow-shell--ot .ot-vitals-strip__card span {
  display: block;
  color: var(--oa-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-flow-shell--ot .ot-vitals-strip__card strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--oa-ink);
  font-size: 1.45rem;
  line-height: 1;
}

.case-flow-shell--ot .ot-vitals-strip__card small {
  color: var(--oa-muted);
  font-size: 0.76rem;
}

.case-flow-shell--ot .ot-vitals-strip__card--critical strong {
  color: var(--oa-danger);
}

.case-flow-shell--ot .ot-vitals-strip__card--warning strong {
  color: var(--oa-amber);
}

.case-flow-shell--ot .ot-chart-panel,
.case-flow-shell--ot .ot-panel,
.case-flow-shell--ot .ot-secondary-panel {
  background: var(--oa-surface);
  border: 1px solid var(--oa-line);
  box-shadow: 0 20px 44px rgba(2, 8, 20, 0.34);
}

.case-flow-shell--ot .ot-chart-panel {
  border-left: 0;
  padding: 1rem 1rem 1.15rem;
}

.case-flow-shell--ot .ot-panel__title {
  color: var(--oa-ink);
  font-size: 0.95rem;
}

.case-flow-shell--ot .ot-panel__subtitle {
  color: var(--oa-muted);
}

.case-flow-shell--ot .ot-chart-frame,
.case-flow-shell--ot .ot-timeline-card,
.case-flow-shell--ot .ot-mini-vital,
.case-flow-shell--ot .ot-setup-card,
.case-flow-shell--ot .ot-review-card {
  background: rgba(15, 25, 45, 0.92);
  border-color: rgba(107, 134, 177, 0.14);
}

.case-flow-shell--ot .ot-chart-frame__inner {
  min-height: 17rem;
}

.case-flow-shell--ot .ot-workspace-grid {
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1.12fr);
  gap: 1rem;
}

.case-flow-shell--ot .ot-panel--accent-green {
  border-left: 0;
  box-shadow: inset 3px 0 0 #18c7b7, 0 20px 44px rgba(2, 8, 20, 0.34);
}

.case-flow-shell--ot .ot-panel--accent-purple {
  border-left: 0;
  box-shadow: inset 3px 0 0 #a578ff, 0 20px 44px rgba(2, 8, 20, 0.34);
}

.case-flow-shell--ot .ot-table-input,
.case-flow-shell--ot .ui-input,
.case-flow-shell--ot select,
.case-flow-shell--ot textarea {
  background: rgba(7, 14, 27, 0.96);
  color: var(--oa-ink);
  border-color: rgba(107, 134, 177, 0.16);
}

.case-flow-shell--ot .ot-table-input::placeholder,
.case-flow-shell--ot .ui-input::placeholder,
.case-flow-shell--ot textarea::placeholder {
  color: #6f86aa;
}

.case-flow-shell--ot .ot-quick-button {
  background: rgba(11, 19, 35, 0.94);
  color: var(--oa-muted);
  border-color: rgba(107, 134, 177, 0.16);
}

.case-flow-shell--ot .ot-quick-button--ghost {
  background: rgba(16, 27, 49, 0.92);
}

.case-flow-shell--ot .ot-monitoring-table th {
  background: rgba(13, 22, 40, 0.96);
  color: var(--oa-muted);
}

.case-flow-shell--ot .ot-monitoring-table td,
.case-flow-shell--ot .ot-monitoring-table th {
  border-color: rgba(148, 163, 184, 0.16);
}

.case-flow-shell--ot .ot-timeline-badge {
  background: rgba(77, 163, 255, 0.12);
  color: var(--oa-brand);
}

.case-flow-shell--ot .ot-inline-warning {
  background: rgba(255, 180, 77, 0.1);
  border-color: rgba(255, 180, 77, 0.16);
  color: var(--oa-amber);
}

.case-flow-shell--ot .ot-timeline-time,
.case-flow-shell--ot .ot-timeline-vitals span,
.case-flow-shell--ot .ot-timeline-drug span,
.case-flow-shell--ot .ot-mini-vital span,
.case-flow-shell--ot .ot-secondary-panel p {
  color: var(--oa-muted);
}

.case-flow-shell--ot .ot-timeline-marker::before {
  background: rgba(107, 134, 177, 0.18);
}

.case-flow-shell--ot .ot-timeline-marker span {
  background: rgba(10, 18, 33, 0.98);
}

.case-flow-shell--ot .ot-timeline-row--vital .ot-timeline-vitals span:first-child strong {
  color: var(--oa-teal);
}

.case-flow-shell--ot .ot-timeline-row--drug .ot-timeline-drug strong {
  color: var(--oa-violet);
}

.case-flow-shell--ot .ot-empty-state--timeline {
  background: rgba(10, 17, 31, 0.88);
  color: var(--oa-muted);
  border-color: rgba(107, 134, 177, 0.18);
}

.case-flow-shell--ot .case-live-section--panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(30rem, calc(100% - 1rem));
  max-height: calc(100vh - 12rem);
  z-index: 16;
}

.case-flow-shell--ot .ot-side-panel-overlay {
  position: absolute;
  inset: 0;
  border-radius: 1.4rem;
  background: rgba(2, 6, 15, 0.42);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 12;
}

.case-flow-shell--ot .ot-side-panel-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.case-flow-shell--ot .ot-secondary-panel {
  padding: 0;
  max-width: none;
  overflow: hidden;
  max-height: inherit;
}

.case-flow-shell--ot .ot-side-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.15rem 1rem;
  border-bottom: 1px solid rgba(107, 134, 177, 0.16);
}

.case-flow-shell--ot .ot-side-panel__header h2 {
  margin: 0;
  color: var(--oa-ink);
  font-size: 1.12rem;
}

.case-flow-shell--ot .ot-side-panel__header p {
  margin: 0.25rem 0 0;
}

.case-flow-shell--ot .ot-side-panel__close {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(107, 134, 177, 0.18);
  border-radius: 999px;
  background: rgba(13, 24, 43, 0.94);
  color: var(--oa-muted);
  font-size: 1.2rem;
  line-height: 1;
}

.case-flow-shell--ot .ot-setup-stack {
  padding: 1rem;
  max-height: calc(100vh - 12rem);
  overflow: auto;
}

.case-flow-shell--ot .ot-inline-select-row {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) auto;
}

.case-flow-shell--ot .ot-inline-select-row--compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.case-flow-shell--ot .ot-review-card {
  margin: 1rem;
}

.case-flow-shell--ot .case-live-section--panel .ui-field {
  margin-bottom: 0.9rem;
}

@media (max-width: 1199.98px) {
  .case-flow-shell--ot .ot-workspace-header {
    grid-template-columns: 1fr;
  }

  .case-flow-shell--ot .case-live-section--panel {
    width: min(30rem, calc(100% - 0.5rem));
    max-height: calc(100vh - 13rem);
  }
}

@media (max-width: 767.98px) {
  .case-flow-shell--ot .ot-vitals-strip,
  .case-flow-shell--ot .ot-workspace-grid {
    grid-template-columns: 1fr;
  }

  .case-flow-shell--ot .case-live-section--panel {
    right: 0;
    left: 0;
    width: 100%;
    max-height: calc(100vh - 13rem);
  }
}

/* Premium OT live workspace */
body.ot-body {
  --ot-live-head: "Syne", "Open Sans", sans-serif;
  --ot-live-body: "DM Sans", "Open Sans", sans-serif;
  --ot-live-mono: "DM Mono", monospace;
}

body.ot-body[data-ot-live-theme="dark"] {
  --ot-live-bg: #07111f;
  --ot-live-bg-2: #0d1b30;
  --ot-live-surface: rgba(11, 20, 37, 0.88);
  --ot-live-surface-2: rgba(17, 31, 56, 0.86);
  --ot-live-surface-3: rgba(8, 16, 31, 0.92);
  --ot-live-border: rgba(132, 154, 190, 0.18);
  --ot-live-text: #eef4ff;
  --ot-live-muted: #92a8cc;
  --ot-live-accent: #52a8ff;
  --ot-live-accent-2: #27d3b5;
  --ot-live-accent-soft: rgba(82, 168, 255, 0.16);
  --ot-live-shadow: 0 24px 60px rgba(2, 8, 20, 0.42);
  --ot-live-chart-text: #9cb0d0;
  --ot-live-chart-grid: rgba(156, 176, 208, 0.12);
  --ot-live-chart-pulse: #4fb2ff;
  --ot-live-chart-pulse-fill: rgba(79, 178, 255, 0.18);
  --ot-live-chart-spo2: #22c7a7;
  --ot-live-chart-spo2-fill: rgba(34, 199, 167, 0.14);
}

body.ot-body[data-ot-live-theme="light"] {
  --ot-live-bg: #eef4fb;
  --ot-live-bg-2: #dbe7f6;
  --ot-live-surface: rgba(255, 255, 255, 0.9);
  --ot-live-surface-2: rgba(247, 250, 255, 0.94);
  --ot-live-surface-3: rgba(241, 246, 253, 0.96);
  --ot-live-border: rgba(56, 86, 128, 0.14);
  --ot-live-text: #10213b;
  --ot-live-muted: #59708f;
  --ot-live-accent: #1868f2;
  --ot-live-accent-2: #0cae92;
  --ot-live-accent-soft: rgba(24, 104, 242, 0.1);
  --ot-live-shadow: 0 22px 48px rgba(26, 56, 99, 0.12);
  --ot-live-chart-text: #557090;
  --ot-live-chart-grid: rgba(85, 112, 144, 0.12);
  --ot-live-chart-pulse: #1868f2;
  --ot-live-chart-pulse-fill: rgba(24, 104, 242, 0.12);
  --ot-live-chart-spo2: #0cae92;
  --ot-live-chart-spo2-fill: rgba(12, 174, 146, 0.12);
}

body.ot-body .ot-main-shell {
  padding: 1.25rem;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(82, 168, 255, 0.2), transparent 24%),
    radial-gradient(circle at bottom right, rgba(39, 211, 181, 0.16), transparent 20%),
    linear-gradient(180deg, var(--ot-live-bg) 0%, var(--ot-live-bg-2) 100%);
  color: var(--ot-live-text);
  font-family: var(--ot-live-body);
}

.ot-live-shell--premium {
  display: grid;
  gap: 1rem;
  color: var(--ot-live-text);
}

.ot-live-shell--premium .ot-live-topbar,
.ot-live-shell--premium .ot-live-hero,
.ot-live-shell--premium .ot-live-snapshot__card,
.ot-live-shell--premium .ot-panel,
.ot-live-shell--premium .ot-chart-panel {
  border: 1px solid var(--ot-live-border);
  background: var(--ot-live-surface);
  box-shadow: var(--ot-live-shadow);
  backdrop-filter: blur(20px);
}

.ot-live-shell--premium .ot-live-topbar,
.ot-live-shell--premium .ot-live-hero {
  border-radius: 1.4rem;
}

.ot-live-shell--premium .ot-live-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(135deg, var(--ot-live-surface) 0%, var(--ot-live-surface-2) 100%);
}

.ot-live-shell--premium .ot-live-topbar__brand,
.ot-live-shell--premium .ot-live-topbar__meta,
.ot-live-shell--premium .ot-live-hero__facts,
.ot-live-shell--premium .ot-live-hero__actions,
.ot-live-shell--premium .ot-live-main-grid,
.ot-live-shell--premium .ot-live-dual-grid,
.ot-live-shell--premium .ot-live-snapshot {
  display: flex;
  gap: 0.85rem;
}

.ot-live-shell--premium .ot-live-topbar__meta,
.ot-live-shell--premium .ot-live-hero__actions {
  align-items: center;
  flex-wrap: wrap;
}

.ot-live-shell--premium .ot-live-topbar__brand {
  flex-direction: column;
  gap: 0.15rem;
}

.ot-live-shell--premium .ot-live-kicker,
.ot-live-shell--premium .ot-live-snapshot__card span,
.ot-live-shell--premium .ot-live-fact-card span,
.ot-live-shell--premium .ot-live-clock-card span {
  color: var(--ot-live-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.ot-live-shell--premium .ot-live-topbar__brand strong,
.ot-live-shell--premium .ot-live-hero__intro h1,
.ot-live-shell--premium .ot-live-fact-card strong,
.ot-live-shell--premium .ot-live-clock-card strong,
.ot-live-shell--premium .ot-live-snapshot__card strong {
  font-family: var(--ot-live-head);
  color: var(--ot-live-text);
}

.ot-live-shell--premium .ot-live-topbar__brand strong {
  font-size: 1rem;
}

.ot-live-shell--premium .ot-live-meta-pill,
.ot-live-shell--premium .ot-live-theme-toggle {
  border-radius: 999px;
  border: 1px solid var(--ot-live-border);
  background: var(--ot-live-surface-3);
  color: var(--ot-live-muted);
  padding: 0.55rem 0.9rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ot-live-shell--premium .ot-live-theme-toggle {
  color: var(--ot-live-text);
}

.ot-live-shell--premium .ot-live-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 1rem;
  padding: 1.25rem;
  background:
    linear-gradient(135deg, var(--ot-live-surface) 0%, var(--ot-live-surface-2) 100%);
}

.ot-live-shell--premium .ot-live-hero__main,
.ot-live-shell--premium .ot-live-hero__rail {
  display: grid;
  gap: 1rem;
}

.ot-live-shell--premium .ot-live-hero__intro h1 {
  margin: 0.2rem 0 0.55rem;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.ot-live-shell--premium .ot-live-hero__intro p,
.ot-live-shell--premium .ot-live-fact-card small,
.ot-live-shell--premium .ot-live-clock-card small {
  margin: 0;
  color: var(--ot-live-muted);
}

.ot-live-shell--premium .ot-live-hero__facts {
  flex-wrap: wrap;
}

.ot-live-shell--premium .ot-live-fact-card,
.ot-live-shell--premium .ot-live-clock-card,
.ot-live-shell--premium .ot-live-snapshot__card {
  flex: 1 1 0;
  min-width: 11rem;
  padding: 1rem;
  border-radius: 1.15rem;
  border: 1px solid var(--ot-live-border);
  background: var(--ot-live-surface-3);
}

.ot-live-shell--premium .ot-live-fact-card strong,
.ot-live-shell--premium .ot-live-clock-card strong,
.ot-live-shell--premium .ot-live-snapshot__card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.2rem;
}

.ot-live-shell--premium .ot-live-clock-card strong {
  font-size: 2rem;
  font-family: var(--ot-live-mono);
}

.ot-live-shell--premium .ot-live-reminder {
  border-radius: 1.1rem;
  background: linear-gradient(135deg, var(--ot-live-accent-soft), rgba(39, 211, 181, 0.12));
  border: 1px solid var(--ot-live-border);
}

.ot-live-shell--premium .ot-live-snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ot-live-shell--premium .ot-live-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.78fr);
  align-items: start;
}

.ot-live-shell--premium .ot-live-main-grid__primary,
.ot-live-shell--premium .ot-live-main-grid__sidebar {
  display: grid;
  gap: 1rem;
}

.ot-live-shell--premium .ot-live-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ot-live-shell--premium .ot-live-chart-panel,
.ot-live-shell--premium .ot-panel {
  border-radius: 1.25rem;
  background: linear-gradient(180deg, var(--ot-live-surface) 0%, var(--ot-live-surface-2) 100%);
}

.ot-live-shell--premium .ot-panel__title,
.ot-live-shell--premium .ot-panel__subtitle,
.ot-live-shell--premium .ot-label,
.ot-live-shell--premium .ot-monitoring-table th,
.ot-live-shell--premium .ot-monitoring-table td,
.ot-live-shell--premium .ot-monitoring-table .ot-empty-state,
.ot-live-shell--premium .ot-shortcut-hints span,
.ot-live-shell--premium .ui-report-list li,
.ot-live-shell--premium .ot-fluid-totals span {
  color: var(--ot-live-text);
}

.ot-live-shell--premium .ot-panel__subtitle,
.ot-live-shell--premium .ot-shortcut-hints span,
.ot-live-shell--premium .ui-report-list li,
.ot-live-shell--premium .ot-fluid-totals span,
.ot-live-shell--premium .ot-empty-state,
.ot-live-shell--premium .ot-alert-banner__message,
.ot-live-shell--premium .ot-status-banner span {
  color: var(--ot-live-muted);
}

.ot-live-shell--premium .ot-vital-card,
.ot-live-shell--premium .ot-chart-frame__inner,
.ot-live-shell--premium .ot-monitoring-table__input-row td,
.ot-live-shell--premium .ot-monitoring-table__data-row td,
.ot-live-shell--premium .ot-quick-button,
.ot-live-shell--premium .ot-chip-button,
.ot-live-shell--premium .ot-shortcut-pill,
.ot-live-shell--premium .ui-input,
.ot-live-shell--premium .ui-select,
.ot-live-shell--premium .ot-table-input,
.ot-live-shell--premium textarea {
  background: var(--ot-live-surface-3);
  border-color: var(--ot-live-border);
  color: var(--ot-live-text);
}

.ot-live-shell--premium .ot-chart-frame__inner {
  box-shadow: inset 0 0 0 1px var(--ot-live-border);
}

.ot-live-shell--premium .ot-chip-button,
.ot-live-shell--premium .ot-shortcut-pill,
.ot-live-shell--premium .ot-quick-button,
.ot-live-shell--premium .ot-primary-button {
  border-radius: 0.95rem;
}

.ot-live-shell--premium .ot-chip-button,
.ot-live-shell--premium .ot-shortcut-pill,
.ot-live-shell--premium .ot-quick-button {
  border: 1px solid var(--ot-live-border);
  color: var(--ot-live-text);
}

.ot-live-shell--premium .ot-chip-button:hover,
.ot-live-shell--premium .ot-shortcut-pill:hover,
.ot-live-shell--premium .ot-quick-button:hover,
.ot-live-shell--premium .ot-live-theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(8, 20, 38, 0.12);
}

.ot-live-shell--premium .ot-primary-button {
  background: linear-gradient(135deg, var(--ot-live-accent), var(--ot-live-accent-2));
  color: #fff;
}

.ot-live-shell--premium .ot-chart-panel__badge,
.ot-live-shell--premium .ot-status-banner,
.ot-live-shell--premium .ot-alert-banner {
  border-radius: 1rem;
}

.ot-live-shell--premium .ot-vitals-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ot-live-shell--premium .ot-vital-card__label,
.ot-live-shell--premium .ot-vital-card__unit {
  color: var(--ot-live-muted);
}

.ot-live-shell--premium .ot-vital-card__value {
  color: var(--ot-live-text);
}

.ot-live-shell--premium .ot-monitoring-table th {
  background: var(--ot-live-surface-2);
}

.ot-live-shell--premium .ot-table-input::placeholder,
.ot-live-shell--premium .ui-input::placeholder,
.ot-live-shell--premium textarea::placeholder {
  color: var(--ot-live-muted);
}

.ot-live-shell--premium .ui-report-list,
.ot-live-shell--premium .ot-fluid-totals,
.ot-live-shell--premium .ot-event-grid {
  gap: 0.75rem;
}

.ot-live-shell--premium .ot-toast-stack {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
}

body.ot-monitoring-mode .ot-live-shell--premium .ot-live-main-grid {
  grid-template-columns: 1fr;
}

body.ot-monitoring-mode .ot-live-shell--premium .ot-live-main-grid__sidebar {
  display: none;
}

@media (max-width: 1199.98px) {
  .ot-live-shell--premium .ot-live-hero,
  .ot-live-shell--premium .ot-live-main-grid {
    grid-template-columns: 1fr;
  }

  .ot-live-shell--premium .ot-vitals-grid,
  .ot-live-shell--premium .ot-live-snapshot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  body.ot-body .ot-main-shell {
    padding: 0.85rem;
  }

  .ot-live-shell--premium .ot-live-topbar,
  .ot-live-shell--premium .ot-live-snapshot,
  .ot-live-shell--premium .ot-live-dual-grid,
  .ot-live-shell--premium .ot-vitals-grid {
    grid-template-columns: 1fr;
  }

  .ot-live-shell--premium .ot-live-topbar,
  .ot-live-shell--premium .ot-live-hero__facts {
    display: grid;
  }
}

/* Continuous hidden-stage case flow */
.case-flow-page {
  background:
    radial-gradient(circle at top left, rgba(24, 104, 242, 0.1), transparent 24%),
    linear-gradient(180deg, #eff5fb 0%, #e3ecf8 100%);
  min-height: 100vh;
}

.case-flow-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 1.4rem 1rem 2rem;
}

.case-flow-panel--continuous {
  transition: opacity 180ms ease, transform 180ms ease;
}

.case-flow-panel--continuous.is-transitioning {
  opacity: 0.7;
  transform: translateY(6px);
}

.case-flow-panel--continuous.is-entered {
  animation: caseFlowPanelIn 220ms ease;
}

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

.case-flow-frame {
  display: grid;
  gap: 1rem;
}

.case-flow-frame--sidebar .case-flow-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.48fr);
  gap: 1rem;
  align-items: start;
}

.case-flow-frame--sidebar .case-flow-workspace__main,
.case-flow-frame--sidebar .case-flow-sidebar {
  min-width: 0;
}

.case-flow-header,
.case-flow-content-shell,
.case-flow-footer {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(78, 105, 145, 0.14);
  border-radius: 1.25rem;
  box-shadow: 0 18px 42px rgba(18, 38, 63, 0.1);
}

.case-flow-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 1rem;
  padding: 1.25rem;
}

.case-flow-header__eyebrow,
.case-flow-footer__stage,
.case-flow-header__meta-card span {
  display: block;
  color: #5f7799;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.case-flow-header__copy h1 {
  margin: 0.25rem 0 0.55rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.05;
  color: #10213b;
}

.case-flow-header__copy p,
.case-flow-footer__support p {
  margin: 0;
  color: #59708f;
}

.case-flow-header__meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.case-flow-header__meta-card {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(244, 248, 253, 0.96);
  border: 1px solid rgba(78, 105, 145, 0.12);
}

.case-flow-header__meta-card strong {
  display: block;
  margin-top: 0.3rem;
  color: #10213b;
  font-size: 1rem;
}

.case-flow-content-shell {
  min-height: 34rem;
  padding: 1.25rem;
}

.case-flow-content-shell--dashboard {
  min-height: 42rem;
}

.case-flow-content {
  min-height: 100%;
}

.case-flow-dashboard-head,
.case-flow-dashboard-actions,
.case-flow-dashboard-grid {
  display: flex;
  gap: 1rem;
}

.case-flow-dashboard-head {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.case-flow-dashboard-head h2 {
  margin: 0.25rem 0 0.5rem;
  color: #10213b;
}

.case-flow-dashboard-head p {
  margin: 0;
  color: #59708f;
}

.case-flow-dashboard-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.case-flow-launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.case-flow-launch-card,
.case-flow-dashboard-card {
  text-align: left;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(78, 105, 145, 0.14);
  background: #f8fbff;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.case-flow-launch-card:hover,
.case-flow-dashboard-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(18, 38, 63, 0.08);
}

.case-flow-launch-card.is-active {
  border-color: rgba(24, 104, 242, 0.28);
  box-shadow: 0 18px 34px rgba(24, 104, 242, 0.1);
}

.case-flow-launch-card span,
.case-flow-dashboard-card span {
  display: block;
  color: #5f7799;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-flow-launch-card strong,
.case-flow-dashboard-card strong {
  display: block;
  margin-top: 0.35rem;
  color: #10213b;
  font-size: 1rem;
}

.case-flow-launch-card small,
.case-flow-dashboard-card p {
  display: block;
  margin-top: 0.35rem;
  color: #59708f;
}

.case-flow-dashboard-grid {
  margin-top: 1rem;
  align-items: stretch;
}

.case-flow-dashboard-card {
  flex: 1 1 0;
}

.case-flow-sidebar {
  position: sticky;
  top: 1rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 42rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(78, 105, 145, 0.14);
  border-radius: 1.25rem;
  box-shadow: 0 24px 48px rgba(18, 38, 63, 0.12);
  overflow: hidden;
  transform: translateX(0);
  transition: transform 220ms ease, opacity 220ms ease;
}

.case-flow-sidebar:not(.is-open) {
  opacity: 0.45;
  transform: translateX(104%);
  pointer-events: none;
}

.case-flow-sidebar__header,
.case-flow-sidebar__footer {
  padding: 1rem 1rem 0.95rem;
  border-bottom: 1px solid rgba(78, 105, 145, 0.1);
}

.case-flow-sidebar__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.case-flow-sidebar__header h3 {
  margin: 0.2rem 0 0.35rem;
  color: #10213b;
}

.case-flow-sidebar__header p {
  margin: 0;
  color: #59708f;
}

.case-flow-sidebar__close {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(78, 105, 145, 0.14);
  background: #f4f8fd;
  color: #59708f;
  font-size: 1.2rem;
  line-height: 1;
}

.case-flow-sidebar__body {
  overflow: auto;
  padding: 1rem;
}

.case-flow-sidebar__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid rgba(78, 105, 145, 0.1);
  border-bottom: 0;
  background: rgba(248, 251, 255, 0.92);
}

.case-flow-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
}

.case-flow-footer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.case-flow-section {
  display: grid;
  gap: 1rem;
}

.case-flow-section__intro {
  max-width: 50rem;
}

.case-flow-section__eyebrow {
  margin: 0 0 0.4rem;
  color: #1868f2;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.case-flow-section__title {
  margin: 0;
  color: #10213b;
  font-size: 1.6rem;
}

.case-flow-section__copy {
  margin: 0.45rem 0 0;
  color: #59708f;
}

.case-flow-content-shell .case-flow-card {
  background: #f8fbff;
}

.case-flow-patient-card[hidden] {
  display: none !important;
}

@media (max-width: 991.98px) {
  .case-flow-frame--sidebar .case-flow-workspace,
  .case-flow-header {
    grid-template-columns: 1fr;
  }

  .case-flow-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .case-flow-footer__actions {
    justify-content: stretch;
  }

  .case-flow-launch-grid,
  .case-flow-dashboard-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .case-flow-sidebar {
    position: static;
    min-height: auto;
  }
}

/* Improved system dark mode */
:root[data-theme="dark"] {
  color-scheme: dark;
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .dashboard-body,
:root[data-theme="dark"] .landing-body {
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 180, 93, 0.16), transparent 27rem),
    radial-gradient(circle at 82% 12%, rgba(86, 116, 232, 0.14), transparent 28rem),
    linear-gradient(180deg, #070c19 0%, #0a1222 50%, #060a14 100%);
  color: var(--app-text);
}

:root[data-theme="dark"] a {
  color: var(--app-link);
}

:root[data-theme="dark"] .dashboard-main,
:root[data-theme="dark"] .dashboard-content-shell {
  background: transparent;
}

:root[data-theme="dark"] .bg-gray-100 {
  background: transparent !important;
}

:root[data-theme="dark"] .bg-white,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .modal-content,
:root[data-theme="dark"] .dropdown-menu,
:root[data-theme="dark"] .list-group-item {
  background-color: #10182b !important;
  color: var(--app-text);
  border-color: rgba(148, 163, 184, 0.2);
}

:root[data-theme="dark"] .text-dark,
:root[data-theme="dark"] .text-body,
:root[data-theme="dark"] .card-title,
:root[data-theme="dark"] label,
:root[data-theme="dark"] .form-label {
  color: var(--app-text) !important;
}

:root[data-theme="dark"] .text-muted,
:root[data-theme="dark"] .card-subtitle,
:root[data-theme="dark"] .small,
:root[data-theme="dark"] small {
  color: var(--app-text-muted) !important;
}

:root[data-theme="dark"] hr,
:root[data-theme="dark"] .border,
:root[data-theme="dark"] .border-top,
:root[data-theme="dark"] .border-bottom,
:root[data-theme="dark"] .border-start,
:root[data-theme="dark"] .border-end {
  border-color: rgba(148, 163, 184, 0.18) !important;
}

:root[data-theme="dark"] .ui-card,
:root[data-theme="dark"] .ui-table-shell,
:root[data-theme="dark"] .ui-stat-card,
:root[data-theme="dark"] .dashboard-hero,
:root[data-theme="dark"] .dashboard-locked-card,
:root[data-theme="dark"] .dashboard-subscription-banner,
:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .app-toast,
:root[data-theme="dark"] .preop-hero,
:root[data-theme="dark"] .postop-hero,
:root[data-theme="dark"] .summary-hero,
:root[data-theme="dark"] .billing-plan-hero,
:root[data-theme="dark"] .billing-pending-hero,
:root[data-theme="dark"] .preop-summary-card,
:root[data-theme="dark"] .summary-highlight-card,
:root[data-theme="dark"] .billing-gateway-card,
:root[data-theme="dark"] .billing-reference-item,
:root[data-theme="dark"] .billing-help-note {
  background:
    linear-gradient(180deg, rgba(19, 29, 50, 0.98), rgba(13, 21, 38, 0.98));
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .ui-page-header__eyebrow,
:root[data-theme="dark"] .case-flow-section__eyebrow {
  color: #ffbd71;
}

:root[data-theme="dark"] .ui-page-header__title,
:root[data-theme="dark"] .ui-card__title,
:root[data-theme="dark"] .ui-stat-card h2,
:root[data-theme="dark"] .ui-activity-row strong,
:root[data-theme="dark"] .ui-field__label,
:root[data-theme="dark"] .dashboard-hero h1,
:root[data-theme="dark"] .dashboard-hero h2,
:root[data-theme="dark"] .billing-plan-hero h2,
:root[data-theme="dark"] .billing-pending-hero h2,
:root[data-theme="dark"] .billing-gateway-card__head h3,
:root[data-theme="dark"] .case-flow-dashboard-head h2,
:root[data-theme="dark"] .case-flow-launch-card strong,
:root[data-theme="dark"] .case-flow-dashboard-card strong,
:root[data-theme="dark"] .case-flow-header__meta-card strong,
:root[data-theme="dark"] .case-flow-sidebar__header h3,
:root[data-theme="dark"] .case-flow-section__title {
  color: #f8fbff;
}

:root[data-theme="dark"] .ui-page-header__subtitle,
:root[data-theme="dark"] .ui-card__subtitle,
:root[data-theme="dark"] .ui-empty-copy,
:root[data-theme="dark"] .ui-field__help,
:root[data-theme="dark"] .ui-activity-row p,
:root[data-theme="dark"] .dashboard-subscription-banner p,
:root[data-theme="dark"] .dashboard-subscription-chip span,
:root[data-theme="dark"] .case-flow-dashboard-head p,
:root[data-theme="dark"] .case-flow-launch-card small,
:root[data-theme="dark"] .case-flow-dashboard-card p,
:root[data-theme="dark"] .case-flow-sidebar__header p,
:root[data-theme="dark"] .case-flow-section__copy {
  color: #c6d5ec;
}

:root[data-theme="dark"] .ui-table-shell__header,
:root[data-theme="dark"] .ui-card__header {
  border-color: rgba(148, 163, 184, 0.14);
}

:root[data-theme="dark"] .ui-table th {
  color: #dce8ff;
  background: rgba(148, 163, 184, 0.06);
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme="dark"] .ui-table td {
  color: #d7e4fb;
  border-bottom-color: rgba(148, 163, 184, 0.12);
}

:root[data-theme="dark"] .ui-table tbody tr:hover td {
  background: rgba(96, 165, 250, 0.08);
}

:root[data-theme="dark"] .ui-table__empty {
  color: #aebfde;
}

:root[data-theme="dark"] .table {
  color: #d7e4fb;
}

:root[data-theme="dark"] .table th,
:root[data-theme="dark"] .table td {
  border-color: rgba(148, 163, 184, 0.14);
}

:root[data-theme="dark"] .table thead th,
:root[data-theme="dark"] .table th {
  color: #dce8ff;
}

:root[data-theme="dark"] .table-hover tbody tr:hover {
  color: #f8fbff;
  background-color: rgba(96, 165, 250, 0.08);
}

:root[data-theme="dark"] .ui-button--primary,
:root[data-theme="dark"] .btn.bg-gradient-primary,
:root[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #ffad4a, #ffd08a);
  border-color: rgba(255, 208, 138, 0.62);
  color: #141827;
  box-shadow: 0 18px 36px rgba(255, 173, 74, 0.26);
}

:root[data-theme="dark"] .ui-button--secondary,
:root[data-theme="dark"] .btn-outline-primary {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(147, 197, 253, 0.34);
  color: #dbeafe;
}

:root[data-theme="dark"] .ui-button--ghost,
:root[data-theme="dark"] .app-toast__close {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
  color: #e7eefb;
}

:root[data-theme="dark"] .ui-button:hover,
:root[data-theme="dark"] .btn:hover {
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark"] .ui-status-pill {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.34);
  color: #d7ddff;
}

:root[data-theme="dark"] .ui-alert--info {
  background: rgba(59, 130, 246, 0.14);
  color: #cfe4ff;
}

:root[data-theme="dark"] .ui-alert--warning {
  background: rgba(245, 158, 11, 0.16);
  color: #ffe0a8;
}

:root[data-theme="dark"] .ui-alert--danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

:root[data-theme="dark"] .ui-alert--success {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

:root[data-theme="dark"] .ui-input,
:root[data-theme="dark"] .auth-form-grid .ui-input,
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] input {
  background: #0b1427;
  border-color: rgba(148, 163, 184, 0.26);
  color: #f8fbff;
}

:root[data-theme="dark"] .ui-input::placeholder,
:root[data-theme="dark"] .form-control::placeholder,
:root[data-theme="dark"] textarea::placeholder,
:root[data-theme="dark"] input::placeholder {
  color: #8da2bf;
}

:root[data-theme="dark"] .ui-input:focus,
:root[data-theme="dark"] .form-control:focus,
:root[data-theme="dark"] .form-select:focus {
  border-color: rgba(255, 180, 93, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 180, 93, 0.16);
}

:root[data-theme="dark"] select option {
  background: #0b1427;
  color: #f8fbff;
}

:root[data-theme="dark"] .dropdown-item {
  color: #d7e4fb;
}

:root[data-theme="dark"] .dropdown-item:hover,
:root[data-theme="dark"] .dropdown-item:focus {
  background: rgba(96, 165, 250, 0.12);
  color: #fff;
}

:root[data-theme="dark"] .dashboard-topbar .container-fluid {
  background:
    linear-gradient(135deg, rgba(255, 173, 74, 0.92) 0%, rgba(99, 75, 129, 0.94) 44%, rgba(27, 37, 82, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .dashboard-topbar__eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

:root[data-theme="dark"] .dashboard-theme-toggle,
:root[data-theme="dark"] .dashboard-user-pill,
:root[data-theme="dark"] .logout-button {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .dashboard-user-pill__avatar {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

:root[data-theme="dark"] .app-sidenav {
  background:
    radial-gradient(circle at 28% 0%, rgba(255, 180, 93, 0.12), transparent 12rem),
    linear-gradient(180deg, #10182b 0%, #0b1324 100%) !important;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.34);
  scrollbar-color: rgba(148, 163, 184, 0.44) transparent;
}

:root[data-theme="dark"] .app-sidenav::-webkit-scrollbar {
  width: 0.55rem;
}

:root[data-theme="dark"] .app-sidenav::-webkit-scrollbar-track {
  background: transparent;
}

:root[data-theme="dark"] .app-sidenav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.38);
  border-radius: 999px;
}

:root[data-theme="dark"] .sidenav-header,
:root[data-theme="dark"] .horizontal.dark {
  border-color: rgba(148, 163, 184, 0.14);
}

:root[data-theme="dark"] .dashboard-sidebar__brand-icon {
  background: linear-gradient(135deg, #ffad4a, #4f63df);
  color: #fff;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .dashboard-sidebar__brand-title {
  color: #fff;
}

:root[data-theme="dark"] .dashboard-sidebar__brand-subtitle,
:root[data-theme="dark"] .dashboard-sidebar__section-label,
:root[data-theme="dark"] .dashboard-sidebar__footer {
  color: #b9c9e2;
}

:root[data-theme="dark"] .app-sidenav .nav-link {
  color: #b9c9e2;
}

:root[data-theme="dark"] .app-sidenav .nav-link:hover {
  background: rgba(96, 165, 250, 0.13);
  color: #f3f8ff;
}

:root[data-theme="dark"] .app-sidenav .nav-link.active {
  background: linear-gradient(135deg, #f7a64a 0%, #5a5fe3 100%);
  color: #fff;
  box-shadow: 0 18px 34px rgba(30, 41, 99, 0.42);
}

:root[data-theme="dark"] .dashboard-sidebar__nav-icon {
  background: rgba(148, 163, 184, 0.13);
  color: inherit;
}

:root[data-theme="dark"] .app-sidenav .nav-link.active .dashboard-sidebar__nav-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

:root[data-theme="dark"] .dashboard-sidebar__footer,
:root[data-theme="dark"] .dashboard-hero__meta span,
:root[data-theme="dark"] .dashboard-subscription-chip,
:root[data-theme="dark"] .preop-hero__badge,
:root[data-theme="dark"] .postop-hero__stats,
:root[data-theme="dark"] .summary-hero__metrics,
:root[data-theme="dark"] .preop-checklist__item {
  background: rgba(148, 163, 184, 0.09);
  border-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme="dark"] .case-flow-header,
:root[data-theme="dark"] .case-flow-content-shell,
:root[data-theme="dark"] .case-flow-sidebar,
:root[data-theme="dark"] .case-flow-launch-card,
:root[data-theme="dark"] .case-flow-dashboard-card,
:root[data-theme="dark"] .case-flow-content-shell .case-flow-card,
:root[data-theme="dark"] .case-flow-header__meta-card {
  background: linear-gradient(180deg, rgba(19, 29, 50, 0.98), rgba(13, 21, 38, 0.98));
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .case-flow-sidebar__footer {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme="dark"] .case-flow-sidebar__close {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
  color: #e7eefb;
}

/* Final dark-mode contrast guard for legacy dashboard components */
:root[data-theme="dark"] .ui-card,
:root[data-theme="dark"] .ui-table,
:root[data-theme="dark"] .ui-table td,
:root[data-theme="dark"] .ui-card__body,
:root[data-theme="dark"] .ui-card__body p,
:root[data-theme="dark"] .ui-card__body span:not(.ui-status-pill) {
  color: #e8f1ff !important;
}

:root[data-theme="dark"] .ui-card__subtitle,
:root[data-theme="dark"] .ui-page-header__subtitle,
:root[data-theme="dark"] .ui-table__empty {
  color: #cbdaf2 !important;
}

:root[data-theme="dark"] .ui-table th {
  color: #dbeafe !important;
  opacity: 1 !important;
}

:root[data-theme="dark"] .ui-button,
:root[data-theme="dark"] .ui-button:link,
:root[data-theme="dark"] .ui-button:visited,
:root[data-theme="dark"] .ui-button:hover,
:root[data-theme="dark"] .ui-button:focus,
:root[data-theme="dark"] .ui-button * {
  color: #ffffff !important;
  opacity: 1 !important;
}

:root[data-theme="dark"] .ui-button--primary,
:root[data-theme="dark"] .ui-button--primary:link,
:root[data-theme="dark"] .ui-button--primary:visited,
:root[data-theme="dark"] .ui-button--primary:hover,
:root[data-theme="dark"] .ui-button--primary:focus {
  color: #111827 !important;
}

:root[data-theme="dark"] .ui-button--secondary {
  background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
  border-color: rgba(147, 197, 253, 0.56) !important;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28) !important;
}

:root[data-theme="dark"] .ui-button--ghost {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(226, 232, 240, 0.28) !important;
}

:root[data-theme="dark"] .ui-status-pill {
  background: rgba(37, 99, 235, 0.34) !important;
  border-color: rgba(147, 197, 253, 0.52) !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

:root[data-theme="dark"] .app-sidenav .nav-link,
:root[data-theme="dark"] .app-sidenav .nav-link .nav-link-text,
:root[data-theme="dark"] .app-sidenav .nav-link i,
:root[data-theme="dark"] .dashboard-sidebar__nav-icon {
  color: #dbeafe !important;
  opacity: 1 !important;
}

:root[data-theme="dark"] .app-sidenav .nav-link:hover,
:root[data-theme="dark"] .app-sidenav .nav-link:hover .nav-link-text,
:root[data-theme="dark"] .app-sidenav .nav-link:hover i,
:root[data-theme="dark"] .app-sidenav .nav-link.active,
:root[data-theme="dark"] .app-sidenav .nav-link.active .nav-link-text,
:root[data-theme="dark"] .app-sidenav .nav-link.active i {
  color: #ffffff !important;
}

/* Dashboard dark-mode parity with the light dashboard */
:root[data-theme="dark"] .dashboard-hero .ui-page-header__eyebrow {
  color: #ffcf91 !important;
  opacity: 1 !important;
}

:root[data-theme="dark"] .dashboard-hero .ui-page-header__title,
:root[data-theme="dark"] .dashboard-hero h1,
:root[data-theme="dark"] .dashboard-hero h2 {
  color: #ffffff !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .dashboard-hero .ui-page-header__subtitle {
  color: #d6e4ff !important;
}

:root[data-theme="dark"] .dashboard-hero__meta span,
:root[data-theme="dark"] .dashboard-hero__meta span i,
:root[data-theme="dark"] .dashboard-subscription-chip,
:root[data-theme="dark"] .dashboard-subscription-chip strong,
:root[data-theme="dark"] .dashboard-subscription-chip span {
  color: #eef6ff !important;
  opacity: 1 !important;
}

:root[data-theme="dark"] .dashboard-hero__meta span,
:root[data-theme="dark"] .dashboard-subscription-chip {
  background: rgba(255, 180, 93, 0.16) !important;
  border: 1px solid rgba(255, 208, 138, 0.18);
}

:root[data-theme="dark"] .dashboard-hero__actions .ui-button--secondary,
:root[data-theme="dark"] .dashboard-hero__actions .ui-button--secondary:link,
:root[data-theme="dark"] .dashboard-hero__actions .ui-button--secondary:visited,
:root[data-theme="dark"] .dashboard-hero__actions .ui-button--secondary:hover,
:root[data-theme="dark"] .dashboard-hero__actions .ui-button--secondary:focus {
  background: rgba(30, 41, 65, 0.88) !important;
  border-color: rgba(203, 213, 225, 0.32) !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] .dashboard-hero__actions .ui-button--primary,
:root[data-theme="dark"] .dashboard-hero__actions .ui-button--primary:link,
:root[data-theme="dark"] .dashboard-hero__actions .ui-button--primary:visited,
:root[data-theme="dark"] .dashboard-hero__actions .ui-button--primary:hover,
:root[data-theme="dark"] .dashboard-hero__actions .ui-button--primary:focus {
  background: linear-gradient(135deg, #ffad4a, #ffc76f) !important;
  border-color: rgba(255, 208, 138, 0.7) !important;
  color: #111827 !important;
}

:root[data-theme="dark"] .ui-stat-card p,
:root[data-theme="dark"] .ui-stat-card__icon,
:root[data-theme="dark"] .ui-stat-card__icon i {
  color: #d9e8ff !important;
  opacity: 1 !important;
}

:root[data-theme="dark"] .ui-stat-card h2 {
  color: #ffffff !important;
}

:root[data-theme="dark"] .ui-activity-row strong,
:root[data-theme="dark"] .ui-activity-row p {
  color: #eaf3ff !important;
  opacity: 1 !important;
}

:root[data-theme="dark"] .ui-activity-row p {
  color: #bcd0ee !important;
}

:root[data-theme="dark"] .ui-table .ui-button--ghost,
:root[data-theme="dark"] .ui-table .ui-button--ghost:link,
:root[data-theme="dark"] .ui-table .ui-button--ghost:visited,
:root[data-theme="dark"] .ui-table .ui-button--ghost:hover,
:root[data-theme="dark"] .ui-table .ui-button--ghost:focus {
  background: rgba(37, 99, 235, 0.2) !important;
  border-color: rgba(147, 197, 253, 0.36) !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] .dashboard-sidebar__brand-title,
:root[data-theme="dark"] .dashboard-sidebar__brand-subtitle,
:root[data-theme="dark"] .dashboard-sidebar__section-label,
:root[data-theme="dark"] .dashboard-sidebar__footer p {
  color: #eef6ff !important;
  opacity: 1 !important;
}

:root[data-theme="dark"] .dashboard-sidebar__brand-subtitle,
:root[data-theme="dark"] .dashboard-sidebar__section-label,
:root[data-theme="dark"] .dashboard-sidebar__footer p {
  color: #c7d7ee !important;
}
