:root {
  --bg: #eef3f5;
  --surface: #ffffff;
  --surface-soft: #f7fafb;
  --line: #dbe5e8;
  --line-strong: #c8d6db;
  --text: #16242d;
  --muted: #647582;
  --brand: #0f6f6d;
  --brand-dark: #0a4e4f;
  --brand-soft: #e5f3f1;
  --accent: #d89b32;
  --danger: #c84c4c;
  --shadow: 0 14px 34px rgba(18, 41, 53, .08);
}

* {
  letter-spacing: 0;
}

body {
  background:
    linear-gradient(180deg, rgba(15, 111, 109, .07), rgba(238, 243, 245, 0) 260px),
    var(--bg);
  color: var(--text);
  font-size: 15px;
}

a {
  text-decoration: none;
}

.app-topbar {
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  min-height: 72px;
}

.brand-lockup {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 12px;
}

.brand-lockup:hover {
  color: var(--text);
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  font-size: 1rem;
  line-height: 1.15;
}

.brand-lockup small {
  color: var(--muted);
  font-size: .76rem;
  margin-top: 2px;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--brand), #143f52);
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(15, 111, 109, .22);
  color: #fff;
  display: inline-flex;
  font-size: .75rem;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 48px;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.user-chip {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: .88rem;
  padding: 8px 12px;
}

.icon-menu {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--brand-dark);
}

.app-sidebar {
  background: #fbfcfd;
  border-right: 1px solid var(--line);
}

.app-sidebar-desktop {
  min-height: calc(100vh - 72px);
  position: sticky;
  top: 72px;
}

.sidebar-inner {
  padding: 14px 10px 24px;
}

.sidebar-section-title {
  color: #7c8c96;
  font-size: .68rem;
  font-weight: 800;
  margin: 14px 10px 7px;
  text-transform: uppercase;
}

.nav-pills .nav-link {
  align-items: center;
  border-radius: 8px;
  color: #2d3d48;
  display: flex;
  font-size: .91rem;
  font-weight: 600;
  gap: 9px;
  min-height: 38px;
  padding: 8px 10px;
}

.nav-pills .nav-link span {
  align-items: center;
  background: #eef3f5;
  border: 1px solid #dde8eb;
  border-radius: 6px;
  color: #758692;
  display: inline-flex;
  font-size: .68rem;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  width: 28px;
}

.nav-pills .nav-link:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.nav-pills .nav-link.active {
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(15, 111, 109, .18);
  color: #fff;
}

.nav-pills .nav-link.active span {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
}

.app-content {
  padding: 22px;
}

.dashboard-hero {
  align-items: center;
  background:
    radial-gradient(circle at 92% 18%, rgba(216, 155, 50, .18), transparent 26%),
    linear-gradient(135deg, #fff, #f7fbfb);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 24px;
}

.dashboard-hero h3 {
  color: #10232d;
  font-size: 1.45rem;
  font-weight: 800;
}

.eyebrow {
  color: var(--brand);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

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

.metric-card {
  min-height: 126px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.metric-card:after {
  background: var(--brand);
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.metric-card span,
.metric-card small,
.panel-header p {
  color: var(--muted);
}

.metric-card span {
  display: block;
  font-size: .86rem;
  margin-bottom: 9px;
}

.metric-card strong {
  color: #10232d;
  display: block;
  font-size: 1.82rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
}

.panel {
  padding: 18px;
}

.module-strip {
  background: #102d36;
  border: 1px solid #1d4854;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}

.module-strip div {
  background: linear-gradient(180deg, #163c47, #102d36);
  min-height: 96px;
  padding: 18px;
}

.module-strip strong,
.module-strip span {
  display: block;
}

.module-strip strong {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 8px;
}

.module-strip span {
  color: #b8cbd0;
  font-size: .86rem;
  line-height: 1.35;
}

.panel-header {
  align-items: start;
  border-bottom: 1px solid #edf2f4;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: -2px 0 14px;
  padding-bottom: 12px;
}

.panel-header h5 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.panel-header p {
  font-size: .86rem;
  margin: 4px 0 0;
}

.btn {
  border-radius: 8px;
  font-weight: 700;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-outline-primary {
  border-color: #9bc6c3;
  color: var(--brand-dark);
}

.btn-outline-primary:hover {
  background: var(--brand);
  border-color: var(--brand);
}

.btn-outline-danger {
  border-color: #e3aaa7;
  color: var(--danger);
}

.table {
  color: var(--text);
}

.table thead th {
  background: #f6fafb;
  border-bottom: 1px solid var(--line);
  color: #51636f;
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.table td,
.table th {
  padding: 11px 10px;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: #fafcfd;
}

.form-control,
.form-select {
  border-color: #cad8dd;
  border-radius: 8px;
  min-height: 40px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(15, 111, 109, .12);
}

.form-control.is-loading {
  background-image: linear-gradient(90deg, rgba(15, 111, 109, .08), rgba(15, 111, 109, .18), rgba(15, 111, 109, .08));
  background-size: 200% 100%;
  animation: field-loading 1s linear infinite;
}

@keyframes field-loading {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.form-label {
  color: #3d4e58;
  font-size: .84rem;
  font-weight: 700;
}

.status-pill {
  background: var(--brand-soft);
  border: 1px solid #c9e4e0;
  border-radius: 999px;
  color: var(--brand-dark);
  display: inline-block;
  font-size: .75rem;
  font-weight: 800;
  padding: 4px 9px;
}

.empty-state {
  color: #7b8790;
  padding: 18px 0;
  text-align: center;
}

.checklist {
  display: grid;
  gap: 11px;
}

.checklist div {
  align-items: center;
  color: #2d3d48;
  display: flex;
  gap: 10px;
}

.checklist span {
  border: 2px solid #b7c5cc;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 15px;
  width: 15px;
}

.checklist span.done {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 111, 109, .1);
}

.timeline-item {
  border-left: 3px solid #d7e5e7;
  padding: 0 0 14px 12px;
}

.timeline-item strong,
.timeline-item small {
  display: block;
}

.timeline-item small {
  color: var(--muted);
  font-size: .78rem;
}

.timeline-item p {
  margin: 6px 0 0;
}

.alert {
  border-radius: 8px;
}

.list-group-item {
  border-color: #edf2f4;
}

h4 {
  font-weight: 800;
}

.landing-body {
  background: #071d24;
  color: #eaf3f4;
}

.landing-nav {
  align-items: center;
  background: rgba(7, 29, 36, .88);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 18px 42px;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 20;
}

.landing-nav .brand-lockup,
.landing-nav .brand-lockup:hover {
  color: #fff;
}

.landing-nav .brand-lockup small {
  color: #a9c2c7;
}

.landing-nav nav {
  align-items: center;
  display: flex;
  gap: 18px;
}

.landing-nav nav a {
  color: #cfe0e3;
  font-weight: 700;
}

.landing-shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 54px 24px;
}

.landing-hero {
  align-items: center;
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 1.2fr) 410px;
  min-height: 620px;
}

.hero-copy h1 {
  color: #fff;
  font-size: clamp(2.4rem, 5vw, 4.9rem);
  font-weight: 900;
  line-height: .98;
  margin: 0 0 22px;
  max-width: 820px;
}

.hero-copy > p {
  color: #bdd3d7;
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 690px;
}

.hero-actions,
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.trust-row span {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  color: #d8e8eb;
  font-size: .84rem;
  font-weight: 700;
  padding: 8px 12px;
}

.login-panel,
.clinical-card {
  background: rgba(255, 255, 255, .97);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
  color: var(--text);
  padding: 26px;
}

.login-panel h2 {
  font-size: 1.4rem;
  font-weight: 900;
}

.login-panel p {
  color: var(--muted);
}

.landing-section {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  color: var(--text);
  margin-top: 22px;
  padding: 34px;
}

.section-heading {
  margin-bottom: 20px;
  max-width: 720px;
}

.section-heading h2,
.split-section h2 {
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  font-weight: 900;
  line-height: 1.08;
}

.feature-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, 1fr);
}

.feature-grid.compact {
  grid-template-columns: repeat(3, 1fr);
}

.feature-grid div {
  background: #f5fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 150px;
  padding: 18px;
}

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

.feature-grid strong {
  color: #10232d;
  font-size: 1.02rem;
  margin-bottom: 10px;
}

.feature-grid span {
  color: var(--muted);
  line-height: 1.5;
}

.split-section {
  align-items: center;
  display: grid;
  gap: 30px;
  grid-template-columns: 1.1fr .9fr;
}

.clinical-card {
  background: #102d36;
  color: #fff;
}

.clinical-card span {
  color: #9fd4d0;
  font-weight: 800;
  text-transform: uppercase;
}

.clinical-card strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1.2;
  margin: 10px 0;
}

.clinical-card p {
  color: #c8dadd;
}

.page-heading {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-heading h4 {
  font-size: 1.65rem;
  margin: 0;
}

.page-heading p:not(.eyebrow) {
  color: var(--muted);
  margin: 6px 0 0;
  max-width: 720px;
}

.empty-panel {
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 42px;
  text-align: center;
}

.patient-profile {
  align-items: center;
  background: linear-gradient(135deg, #0f6f6d, #143f52);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #fff;
  display: flex;
  gap: 18px;
  padding: 24px;
}

.profile-avatar {
  align-items: center;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 50%;
  display: flex;
  font-size: 1.8rem;
  font-weight: 900;
  height: 74px;
  justify-content: center;
  width: 74px;
}

.patient-profile h3 {
  font-weight: 900;
  margin: 0;
}

.patient-profile p {
  color: #d6e8ea;
  margin: 4px 0 12px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-tags span {
  background: rgba(255,255,255,.14);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  padding: 6px 10px;
}

.info-list {
  display: grid;
  gap: 10px;
  grid-template-columns: 120px 1fr;
  margin: 0;
}

.info-list dt {
  color: var(--muted);
  font-weight: 800;
}

.info-list dd {
  margin: 0;
}

.care-alert {
  background: #fff6e5;
  border: 1px solid #ecd7a9;
  border-radius: 8px;
  color: #6c4d0f;
  font-weight: 700;
  margin-bottom: 10px;
  padding: 12px;
}

.care-alert.soft {
  background: var(--brand-soft);
  border-color: #c9e4e0;
  color: var(--brand-dark);
}

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

.flow-list div,
.family-preview {
  background: #f6fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.flow-list strong,
.flow-list span,
.family-preview strong,
.family-preview span {
  display: block;
}

.flow-list span,
.family-preview span {
  color: var(--muted);
  margin-top: 4px;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.feature-list span {
  background: var(--brand-soft);
  border: 1px solid #c9e4e0;
  border-radius: 999px;
  color: var(--brand-dark);
  font-weight: 800;
  padding: 8px 11px;
}

.module-strip.light {
  background: #e5eef1;
}

.module-strip.light div {
  background: #f8fbfc;
}

.module-strip.light strong {
  color: var(--text);
}

.module-strip.light span {
  color: var(--muted);
}

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

.abc-grid div {
  background: #102d36;
  border-radius: 8px;
  color: #fff;
  min-height: 132px;
  padding: 18px;
}

.abc-grid strong {
  color: #9fd4d0;
  display: block;
  font-size: 2rem;
  font-weight: 900;
}

.abc-grid span {
  color: #d1e2e5;
}

.big-signal {
  align-items: baseline;
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.big-signal strong {
  color: var(--brand-dark);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
}

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

@media (max-width: 992px){
  .app-content {
    padding: 16px;
  }

  .offcanvas-start{
    width: 282px;
  }

  .brand-lockup small,
  .user-chip {
    display: none;
  }

  .dashboard-hero,
  .panel-header,
  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-actions {
    justify-content: flex-start;
  }

  .module-strip {
    grid-template-columns: 1fr;
  }

  .landing-nav {
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
  }

  .landing-nav,
  .landing-nav nav,
  .landing-hero,
  .split-section {
    grid-template-columns: 1fr;
  }

  .landing-nav {
    flex-direction: column;
  }

  .landing-nav nav {
    flex-wrap: wrap;
  }

  .landing-shell {
    padding: 28px 14px;
  }

  .landing-hero {
    display: grid;
    min-height: auto;
  }

  .feature-grid,
  .feature-grid.compact,
  .abc-grid {
    grid-template-columns: 1fr;
  }

  .login-panel,
  .landing-section {
    padding: 20px;
  }
}
