/* Logged-in application shell. Public pages retain the existing site header. */
body.cdm-app-shell {
  --cdm-sidebar-width: 244px;
  --cdm-app-header-height: 62px;
  --cdm-app-navy: #173a5d;
  --cdm-app-blue: #176a9d;
  --cdm-app-blue-soft: #eaf4fa;
  --cdm-app-border: #d8e2ea;
  --cdm-app-muted: #647789;
  padding-left: var(--cdm-sidebar-width);
  background: #f6f8fa;
}

body.cdm-app-shell > #header {
  left: var(--cdm-sidebar-width);
  right: 0;
  height: var(--cdm-app-header-height);
  padding: 0;
  background: #fff;
  border-bottom: 1px solid var(--cdm-app-border);
  box-shadow: none;
  z-index: 996;
}

body.cdm-app-shell > #header.sticked {
  box-shadow: none;
}

body.cdm-app-shell > section:first-of-type,
body.cdm-app-shell > main:first-of-type {
  padding-top: 32px;
}

.cdm-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 998;
  width: var(--cdm-sidebar-width);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--cdm-app-border);
  color: var(--cdm-app-navy);
}

.cdm-sidebar-brand {
  min-height: 96px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--cdm-app-border);
}

.cdm-sidebar-brand img {
  display: block;
  width: 156px;
  height: 72px;
  object-fit: cover;
  object-position: center;
}

.cdm-sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 12px;
  scrollbar-width: thin;
}

.cdm-sidebar-link,
.cdm-sidebar-account,
.cdm-sidebar-logout {
  color: #354b5e;
  text-decoration: none;
}

.cdm-sidebar-link {
  min-height: 42px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cdm-sidebar-link + .cdm-sidebar-link {
  margin-top: 2px;
}

.cdm-sidebar-link i {
  width: 20px;
  flex: 0 0 20px;
  color: #688093;
  font-size: 17px;
  text-align: center;
}

.cdm-sidebar-link:hover,
.cdm-sidebar-link:focus-visible {
  color: var(--cdm-app-navy);
  background: #f1f5f8;
}

.cdm-sidebar-link.is-active {
  color: #105f91;
  background: var(--cdm-app-blue-soft);
  font-weight: 700;
}

.cdm-sidebar-link.is-active i {
  color: #1473aa;
}

.cdm-sidebar-section-label {
  margin: 20px 12px 7px;
  color: #8393a1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cdm-sidebar-footer {
  flex: 0 0 auto;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--cdm-app-border);
}

.cdm-sidebar-account {
  margin-top: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 7px;
}

.cdm-sidebar-account:hover,
.cdm-sidebar-account:focus-visible,
.cdm-sidebar-account.is-active {
  color: var(--cdm-app-navy);
  background: #f1f5f8;
}

.cdm-user-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--cdm-app-blue);
  font-size: 14px;
  font-weight: 700;
}

.cdm-user-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.cdm-user-details strong {
  overflow: hidden;
  color: var(--cdm-app-navy);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cdm-user-details small {
  margin-top: 2px;
  color: var(--cdm-app-muted);
  font-size: 12px;
}

.cdm-sidebar-logout {
  padding: 8px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cdm-app-muted);
  border-radius: 7px;
  font-size: 14px;
}

.cdm-sidebar-logout:hover,
.cdm-sidebar-logout:focus-visible {
  color: var(--cdm-app-navy);
  background: #f1f5f8;
}

.cdm-app-topbar {
  width: 100%;
  height: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.cdm-app-topbar-title {
  display: none;
  color: var(--cdm-app-navy);
  font-family: var(--font-secondary);
  font-size: 19px;
  font-weight: 600;
}

.cdm-sidebar-toggle,
.cdm-sidebar-scrim {
  display: none;
}

@media (min-width: 1024px) {
  body.cdm-app-shell > #header {
    position: static !important;
    width: 0;
    height: 0;
    min-height: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  body.cdm-app-shell > #header .cdm-app-topbar {
    display: none;
  }
}

body.cdm-app-shell .referral-list-header {
  padding-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  text-align: left;
}

body.cdm-app-shell .referral-list-header h2 {
  margin: 0;
}

body.cdm-referral-summary #about {
  padding-top: 36px;
  padding-bottom: 48px;
}

body.cdm-referral-summary .referral-list-header h2 {
  font-size: 40px;
  line-height: 1.1;
}

body.cdm-referral-summary .referral-list-header {
  width: 100%;
  justify-content: space-between;
}

.referral-new-button {
  min-height: 44px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  color: #fff;
  background: var(--cdm-app-blue);
  font-weight: 700;
  text-decoration: none;
}

.referral-new-button:hover,
.referral-new-button:focus-visible {
  color: #fff;
  background: #115b88;
}

/* Keep the wide referral index contained within the application workspace. */
body.cdm-referral-summary #about {
  width: 100%;
  max-width: calc(100vw - var(--cdm-sidebar-width));
  overflow: hidden;
}

body.cdm-referral-summary #about > .container,
body.cdm-referral-summary #about .row,
body.cdm-referral-summary #about .col-lg-12,
body.cdm-referral-summary #about .tab-content,
body.cdm-referral-summary #about .tab-pane {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

body.cdm-referral-summary #about > .container {
  max-width: none;
  padding-right: 32px;
  padding-left: 32px;
}

body.cdm-referral-summary #about .row {
  margin-right: 0;
  margin-left: 0;
}

body.cdm-referral-summary #about .col-lg-12 {
  padding-right: 0;
  padding-left: 0;
}

body.cdm-referral-summary #about .nav-pills {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

body.cdm-referral-summary #about .referral-filter-tabs {
  align-items: center;
  gap: 24px;
  margin: 0;
}

body.cdm-referral-summary #about .referral-filter-tabs li + li {
  margin-left: 0;
}

body.cdm-referral-summary #about .referral-filter-tabs .nav-link {
  padding: 10px 0;
  font-size: 16px;
  line-height: 1.25;
  white-space: nowrap;
}

body.cdm-referral-summary #about .referral-filter-tabs .referral-new-button {
  min-height: 38px;
  padding: 8px 14px;
  color: #fff;
}

body.cdm-referral-summary #about .referral-filter-tabs .referral-new-button:hover,
body.cdm-referral-summary #about .referral-filter-tabs .referral-new-button:focus-visible {
  color: #fff;
}

body.cdm-referral-summary #about .tab-pane.active {
  position: relative;
  padding-top: 18px;
  overflow: hidden;
}

body.cdm-referral-summary #about .tab-pane > br:first-child {
  display: none;
}

body.cdm-referral-summary #about .tab-pane > [id^="toolbar_"] {
  display: none;
}

body.cdm-referral-summary .referral-print-action {
  min-width: 72px;
  display: flex;
  justify-content: flex-end;
}

body.cdm-referral-summary .referral-print-action .dt-buttons {
  display: none;
}

body.cdm-referral-summary #about button.printButton {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--cdm-app-border);
  border-radius: 7px;
  color: var(--cdm-app-navy);
  background: #fff;
  font-weight: 650;
  line-height: 1.2;
}

body.cdm-referral-summary #about button.printButton:hover,
body.cdm-referral-summary #about button.printButton:focus-visible {
  border-color: var(--cdm-app-blue);
  color: var(--cdm-app-blue);
  background: #f7fbfe;
}

body.cdm-referral-summary #about .dt-container > .dt-layout-row:first-child {
  min-height: 42px;
  margin: 0 0 16px;
  padding-left: 0;
  align-items: center;
  flex-direction: row-reverse;
}

body.cdm-referral-summary #about .dt-container {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

body.cdm-referral-summary #about .dt-layout-row,
body.cdm-referral-summary #about .dt-layout-cell {
  min-width: 0;
  max-width: 100%;
}

body.cdm-referral-summary #about .dt-layout-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

body.cdm-referral-summary #about table.dataTable {
  min-width: 1500px;
}

@media (max-width: 1023px) {
  body.cdm-app-shell {
    padding-left: 0;
  }

  body.cdm-app-shell > #header {
    left: 0;
  }

  body.cdm-referral-summary #about {
    max-width: 100vw;
  }

  body.cdm-app-shell > section:first-of-type,
  body.cdm-app-shell > main:first-of-type {
    padding-top: calc(var(--cdm-app-header-height) + 24px);
  }

  .cdm-sidebar {
    width: min(86vw, 280px);
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 30px rgba(24, 50, 70, 0.18);
  }

  .cdm-sidebar-toggle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cdm-app-border);
    border-radius: 7px;
    color: var(--cdm-app-navy);
    background: #fff;
    font-size: 23px;
  }

  .cdm-app-topbar {
    padding: 0 18px;
  }

  .cdm-app-topbar-title {
    display: block;
  }

  .cdm-sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 997;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(17, 35, 51, 0.42);
  }

  body.cdm-sidebar-open {
    overflow: hidden;
  }

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

  body.cdm-sidebar-open .cdm-sidebar-scrim {
    display: block;
  }
}

@media (max-width: 767px) {
  body.cdm-referral-summary #about {
    padding-top: 24px;
  }

  body.cdm-referral-summary .referral-list-header {
    align-items: flex-start;
  }

  body.cdm-referral-summary #about .referral-filter-tabs {
    gap: 20px;
  }

  body.cdm-referral-summary #about .dt-container > .dt-layout-row:first-child {
    padding-left: 0;
  }
}

@media (max-width: 575px) {
  .cdm-app-topbar-title {
    font-size: 17px;
  }

  body.cdm-app-shell .referral-list-header {
    align-items: stretch;
    flex-direction: column;
  }

  .referral-new-button {
    justify-content: center;
  }
}

@media print {
  body.cdm-app-shell {
    padding-left: 0;
    background: #fff;
  }

  body.cdm-app-shell > #header,
  .cdm-sidebar,
  .cdm-sidebar-scrim {
    display: none !important;
  }
}
