:root {
  color-scheme: light;
}

body {
  background: #f8f9fa;
  color: #2c3e50;
}

.chart-frame {
  position: relative;
  height: 270px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.network-charts {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.6rem;
  align-items: stretch;
}

.network-charts .chart-services {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.network-charts .chart-services .chart-frame {
  flex: 1;
  height: auto;
  min-height: 270px;
}

.network-charts .chart-district .chart-frame {
  height: 360px;
}

@media (min-width: 1200px) {
  .network-charts {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .network-charts .chart-daily { grid-column: 1; grid-row: 1; }
  .network-charts .chart-district { grid-column: 1; grid-row: 2; }
  .network-charts .chart-services { grid-column: 2; grid-row: 1 / span 2; }
}

.chart-frame.tall {
  height: 310px;
}

.chart-frame canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
}

main {
  min-width: 0;
  max-width: 100%;
}

.rail-btn.is-selected {
  background: #eaf1f8;
  color: #1a4c81;
  font-weight: 600;
}

.rail-district {
  margin: 8px 8px 1px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6c757d;
}

.rail-name {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 3px 8px;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
  line-height: 1.25;
}

.rail-dot {
  flex: 0 0 auto;
}

/* Header: title on the left, stat cards filling the rest of the row. */
.network-head {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px 20px;
}
.nh-title { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; }
.nh-range { margin: 6px 0 0; font-size: 12px; color: #6c757d; }
/* Small, quiet cards that sit to the right of the title instead of filling the row. */
.nh-stats {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 200px));
  justify-content: end;
  align-content: center;
  gap: 6px;
}
.nh-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #eceef1;
  border-radius: 10px;
}
.nh-stat.hidden { display: none; }
.nh-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #9aa1a9; }
.nh-stat b { font-family: inherit; font-size: 1.1rem; font-weight: 500; line-height: 1.2; margin-top: 1px; color: #2b2f33; }
.nh-stat small { font-size: 11px; color: #9aa1a9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Very soft alert tint: only the dot carries the red. */
.nh-stat.is-alert { background: #fdf8f7; border-color: #f3e3e1; }
.nh-stat.is-alert .nh-label::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #d08a83; margin-right: 5px; vertical-align: 1px; }
#nhSilentNames { white-space: nowrap; }
@media (max-width: 1100px) {
  .nh-stats { flex-basis: 100%; justify-content: start; grid-template-columns: repeat(4, minmax(0, 200px)); }
}
@media (max-width: 640px) {
  .nh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.owner-note {
  margin: 4px 0 0;
  max-width: 70rem;
  font-size: 13px;
  line-height: 1.35;
  color: #6c757d;
}

#activeSummary.owner-note {
  color: #1a4c81;
}

.usage-block {
  margin-top: 10px;
}

.usage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 8px;
}

.usage-head p {
  margin: 0;
  font-size: 12px;
  color: #6c757d;
}

.usage-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
  .usage-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .usage-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

.usage-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 1px;
  align-items: center;
  min-height: 56px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
}

.usage-icon {
  grid-row: 1 / span 3;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #e7eef5;
  color: #1a4c81;
  display: flex;
  align-items: center;
  justify-content: center;
}

.usage-label {
  margin: 0;
  min-height: 2.4em;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
  color: #6c757d;
}

@media (min-width: 1200px) {
  .usage-label {
    min-height: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.usage-figure {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1;
  color: #1a4c81;
}

.usage-today {
  grid-column: 2;
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  color: #17a2b8;
}

.transfer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 8px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
}

.transfer-kicker {
  margin: 0;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.15rem;
  color: #1a4c81;
}

.transfer-stats {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 14px;
  color: #2c3e50;
}

.transfer-stats strong {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: #1a4c81;
}

.transfer-stats .is-shared strong { color: #28a745; }
.transfer-stats .is-missed strong { color: #dc3545; }

.transfer-note {
  margin: 0;
  flex: 1 1 16rem;
  font-size: 12px;
  line-height: 1.35;
  color: #6c757d;
}

tr.is-zero td {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.06);
}

/* Compact facility table */
.fac-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 10px 14px 8px;
}
.fac-toolbar .fac-toggle { margin-left: auto; }
.fac-toggle {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 12px;
  color: #52514e;
  background: #fff;
}
.fac-toggle[aria-pressed="true"] { background: #1a4c81; border-color: #1a4c81; color: #fff; }
.fac-table { font-size: 13px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fac-table th, .fac-table td { padding: 5px 12px; white-space: nowrap; }
.fac-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6c757d;
}
.fac-table thead th button { all: unset; cursor: pointer; }
.fac-table thead th button:focus-visible { outline: 2px solid #1a4c81; outline-offset: 2px; }
.fac-table thead th[aria-sort="ascending"], .fac-table thead th[aria-sort="descending"] { color: #0b0b0b; }
.fac-row { border-top: 1px solid #f0f2f4; cursor: pointer; }
.fac-row:hover td { background: #eef3f8; }
.fac-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.fac-code { margin-left: 6px; font-size: 11px; color: #898781; }
.fac-rank { display: inline-block; min-width: 1.6em; color: #898781; font-size: 11px; }
.fac-strong { font-weight: 600; }
.fac-zero { color: #c3c2b7; }
.fac-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #52514e; }
.fac-spark { padding-top: 3px; padding-bottom: 3px; }
.fac-group td {
  background: #eef3f8;
  border-top: 1px solid #dde6ef;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #1a4c81;
}
.fac-group-name { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #0b0b0b; }
.fac-group .fac-code { font-weight: 400; letter-spacing: 0; text-transform: none; }
.fac-flag { font-size: 11px; font-weight: 600; color: #b42318; }
.fac-table tr.is-zero td { color: #b42318; background: rgba(220, 53, 69, 0.05); }
.fac-table tr.is-zero .fac-zero, .fac-table tr.is-zero .fac-code { color: #d98d86; }

.live-dot {
  animation: pulse-dot 1.8s ease-out infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.45); }
  100% { box-shadow: 0 0 0 8px rgba(40, 167, 69, 0); }
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
}

.load-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.load-stage.is-done {
  display: none;
}

.load-count {
  margin: 0;
  min-width: 0;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1rem;
  line-height: 1;
  color: #1a4c81;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.load-count-of,
#loadCountTotal {
  margin-left: 0.28rem;
  font-size: 1rem;
  color: #6c757d;
  letter-spacing: 0.04em;
}

.load-caption {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6c757d;
  white-space: nowrap;
}

.load-scene {
  flex: 1 1 140px;
  max-width: 220px;
  height: 8px;
}

.load-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #e7eef5;
  box-shadow: inset 0 1px 2px rgba(26, 76, 129, 0.18);
  overflow: hidden;
}

.load-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1a4c81 0%, #17a2b8 100%);
  background-size: 200% 100%;
  animation: load-sheen 1.6s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(23, 162, 184, 0.45);
  transition: width 0.45s ease;
}

.load-stage.is-done .load-fill {
  animation: none;
}

@keyframes load-sheen {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#detailView {
  min-height: 70vh;
}

#detailView.is-reading > :not(#facilityLoader) {
  display: none;
}

.facility-loader.hidden {
  display: none;
}

.facility-loader {
  position: relative;
  z-index: 4;
  min-height: calc(100vh - 11rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 50% 42%, rgba(156, 227, 236, 0.55), transparent 42%),
    linear-gradient(180deg, #f8f9fa 0%, #e7eef5 100%);
}

.facility-loader-bg {
  position: absolute;
  width: 520px;
  height: 520px;
  background: url("img/medisoft.jpeg") center / contain no-repeat;
  opacity: 0.14;
  filter: blur(0.2px);
  animation: logo-drift 9s ease-in-out infinite;
}

.facility-orbit {
  position: absolute;
  width: 280px;
  height: 280px;
  transform-style: preserve-3d;
  animation: orbit-spin 7s linear infinite;
}

.facility-orbit span {
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(26, 76, 129, 0.35);
  border-radius: 50%;
  transform: rotateX(68deg);
}

.facility-orbit span:nth-child(2) {
  inset: 42px;
  border-color: rgba(23, 162, 184, 0.7);
  animation: orbit-spin 4.5s linear infinite reverse;
}

.facility-orbit span:nth-child(3) {
  inset: 68px;
  border-color: rgba(26, 76, 129, 0.2);
  transform: rotateY(72deg);
}

.facility-logo-stage {
  position: relative;
  width: 148px;
  height: 148px;
  perspective: 800px;
  z-index: 1;
}

.facility-logo {
  width: 148px;
  height: 148px;
  object-fit: contain;
  background: #fff;
  border-radius: 28px;
  padding: 12px;
  box-shadow:
    0 18px 0 rgba(26, 76, 129, 0.12),
    0 28px 40px rgba(26, 76, 129, 0.28);
  animation: logo-turn 4.8s ease-in-out infinite;
}

.facility-loader-kicker {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #17a2b8;
}

#facilityLoaderName {
  position: relative;
  z-index: 1;
}

.facility-loader-note {
  position: relative;
  z-index: 1;
  max-width: 22rem;
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: #6c757d;
}

@keyframes logo-turn {
  0% { transform: rotateY(-28deg) rotateX(8deg) translateY(0); }
  50% { transform: rotateY(28deg) rotateX(-6deg) translateY(-8px); }
  100% { transform: rotateY(-28deg) rotateX(8deg) translateY(0); }
}

@keyframes logo-drift {
  0%, 100% { transform: translate3d(-12px, 8px, 0) scale(1.05); }
  50% { transform: translate3d(16px, -14px, 0) scale(1.12); }
}

@keyframes orbit-spin {
  from { transform: rotateZ(0deg); }
  to { transform: rotateZ(360deg); }
}

.module-tab {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  padding: 0.7rem 1rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}

.module-tab:hover {
  color: #fff;
}

.module-tab.is-active {
  color: #fff;
  border-bottom-color: #9ce3ec;
}

.cbhi-toolbar {
  margin-bottom: 0.75rem;
}

.cbhi-frame {
  width: 100%;
  min-height: calc(100vh - 12rem);
  height: calc(100vh - 12rem);
  border: 1px solid #dee2e6;
  border-radius: 1rem;
  background: #fff;
}

body.is-cbhi-tab .range-field {
  display: none;
}

body.is-cbhi-only .network-patients,
body.is-cbhi-only #loadStage,
body.is-cbhi-only .owner-note,
body.is-cbhi-only .usage-block,
body.is-cbhi-only .transfer-line,
body.is-cbhi-only .network-charts,
body.is-cbhi-only #facilityTable {
  display: none !important;
}

.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 249, 250, 0.92);
  backdrop-filter: blur(2px);
}

.boot-loader.hidden {
  display: none !important;
}

.boot-loader-card {
  text-align: center;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 1.25rem;
  padding: 2rem 2.25rem;
  box-shadow: 0 10px 30px rgba(26, 76, 129, 0.08);
  max-width: 22rem;
}

.boot-loader-kicker {
  margin-top: 1rem;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #17a2b8;
}

.boot-loader-text {
  margin-top: 0.45rem;
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.4;
}

.boot-spinner {
  width: 2.4rem;
  height: 2.4rem;
  margin: 0 auto;
  border: 3px solid #dee2e6;
  border-top-color: #1a4c81;
  border-radius: 50%;
  animation: boot-spin 0.8s linear infinite;
}

.users-admin-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  background: #fff;
}

.users-admin-tab {
  border: 0;
  background: transparent;
  color: #6c757d;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
}

.users-admin-tab.is-active {
  background: #1a4c81;
  color: #fff;
}

.users-section-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #17a2b8;
  font-weight: 700;
}

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

body.is-booting #boardLayout {
  visibility: hidden;
}

.cbhi-frame-wrap {
  position: relative;
}

.cbhi-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dee2e6;
  border-radius: 1rem;
}

.cbhi-loader.hidden {
  display: none !important;
}

.rail-btn.is-loading {
  opacity: 0.7;
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, #f8f9fa 0%, #e7eef5 100%);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 1.5rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 18px 48px rgba(26, 76, 129, 0.12);
}

@media (min-width: 640px) {
  .login-card {
    padding: 2.35rem 2.25rem;
  }
}

.activity-pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#monthPick option { color: #0b0b0b; background: #fff; }

/* ==== Smart monitoring cards (2026-11-27) ==== */
/* Header: value with a small trend / progress beside it, kept within the quiet card size. */
.nh-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nh-row b { flex: none; }
.nh-spark { flex: 1 1 auto; min-width: 30px; height: 18px; margin-left: 2px; }
.nh-delta { flex: none; font-size: 10px; font-weight: 600; color: #1a4c81; background: #eaf1f8; border-radius: 999px; padding: 1px 6px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.nh-delta.is-flat { color: #6c757d; background: #f1f3f5; }
.nh-bar { flex: 1 1 auto; height: 5px; border-radius: 3px; background: #eceef1; overflow: hidden; margin-left: 4px; }
.nh-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: #5fa868; transition: width .3s ease; }
@media (prefers-reduced-motion: reduce) { .nh-bar i { transition: none; } }

/* Usage cards: per-day average and how many centres use the service. */
.usage-avg { color: #9aa1a9; }
.usage-adopt { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 10px; color: #6c757d; white-space: nowrap; }
.usage-adopt > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.usage-adopt-bar { flex: 1 1 auto; min-width: 24px; height: 4px; border-radius: 2px; background: #eceef1; overflow: hidden; }
.usage-adopt-bar i { display: block; height: 100%; border-radius: 2px; background: #17a2b8; }
.usage-card.is-low .usage-adopt-bar i { background: #d9b45c; }
.usage-card.is-idle { background: #fafbfc; }
.usage-card.is-idle .usage-figure, .usage-card.is-idle .usage-today { color: #9aa1a9; }
.usage-card.is-idle .usage-icon { background: #f1f3f5; color: #9aa1a9; }

/* Month filter under the page title: quiet pill, same months as the header picker. */
.nh-month { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 8px; padding: 0 4px 0 10px; height: 30px; border: 1px solid #dee2e6; border-radius: 999px; background: #fff; color: #1a4c81; transition: border-color .12s ease; }
.nh-month:hover { border-color: #b8c7d8; }
.nh-month:focus-within { border-color: #1a4c81; box-shadow: 0 0 0 3px rgba(26, 76, 129, .12); }
.nh-month select { appearance: auto; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 500; color: #1a4c81; padding: 0 2px; height: 28px; cursor: pointer; outline: none; }

/* ==== Users page (2026-11-28): full-width accounts table, side panel for view / add / edit ==== */
.users-msg { font-size: 0.875rem; border-radius: 0.75rem; padding: 0.55rem 0.8rem; background: #fdf5f4; border: 1px solid #f3dcd9; color: #9a2a1e; }
.users-msg.is-ok { background: #f1f8f1; border-color: #d9ead9; color: #1f6b28; }

.users-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid #e9ecef; }
.users-search { position: relative; flex: 1 1 15rem; max-width: 21rem; }
.users-search svg { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: #9aa1a9; pointer-events: none; }
.users-search input { width: 100%; height: 2.25rem; padding: 0 0.6rem 0 2.1rem; border: 1px solid #dee2e6; border-radius: 0.65rem; font-size: 0.875rem; color: #1f2933; background: #fff; outline: none; }
.users-select, .users-date input { height: 2.25rem; padding: 0 0.6rem; border: 1px solid #dee2e6; border-radius: 0.65rem; font-size: 0.875rem; color: #1f2933; background: #fff; outline: none; max-width: 14rem; }
.users-date { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: #6c757d; }
.users-search input:focus, .users-select:focus, .users-date input:focus,
.uf-field input:focus, .uf-field select:focus, .uf-fac-tools input:focus { border-color: #1a4c81; box-shadow: 0 0 0 3px rgba(26, 76, 129, 0.12); }

.users-filters { display: flex; flex-wrap: wrap; gap: 0.25rem; flex: 1 1 auto; }
.users-filter { border: 1px solid transparent; background: transparent; color: #6c757d; font-size: 0.8rem; padding: 0.3rem 0.65rem; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.users-filter b { font-weight: 500; color: #9aa1a9; margin-left: 0.3rem; font-variant-numeric: tabular-nums; }
.users-filter:hover { background: #f4f6f8; color: #1a4c81; }
.users-filter.is-active { background: #eaf1f8; border-color: #d3e0ee; color: #1a4c81; font-weight: 600; }
.users-filter.is-active b { color: #1a4c81; opacity: 0.7; }

.users-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; height: 2.25rem; padding: 0 0.9rem; border-radius: 0.65rem; border: 1px solid #dee2e6; background: #fff; color: #1a4c81; font-size: 0.875rem; white-space: nowrap; cursor: pointer; }
.users-btn:hover { border-color: #b8c7d8; background: #f8fafc; }
.users-btn.is-primary { background: #1a4c81; border-color: #1a4c81; color: #fff; font-weight: 500; }
.users-btn.is-primary:hover { background: #163f6b; border-color: #163f6b; }
.users-btn.is-small { height: 1.85rem; padding: 0 0.7rem; font-size: 0.8rem; border-radius: 0.55rem; }
.users-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.users-btn:focus-visible, .users-filter:focus-visible, .users-admin-tab:focus-visible, .drawer-x:focus-visible, .uf-linkbtn:focus-visible { outline: 2px solid #1a4c81; outline-offset: 2px; }
.uf-linkbtn { border: 0; background: none; padding: 0; color: #1a4c81; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.uf-linkbtn:hover { text-decoration: underline; }

.users-table th { padding: 0.55rem 0.7rem; text-align: left; font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: #6c757d; background: #f8f9fa; white-space: nowrap; }
.users-table td { padding: 0.6rem 0.7rem; border-top: 1px solid #eef0f2; vertical-align: middle; color: #1f2933; }
.users-table.is-compact th { padding: 0.45rem 0.75rem; }
.users-table.is-compact td { padding: 0.45rem 0.75rem; vertical-align: top; font-size: 0.82rem; }
.users-table tbody tr[data-user] { cursor: pointer; }
.users-table tbody tr[data-user]:hover { background: #f8fafc; }
.users-table tbody tr.is-selected, .users-table tbody tr.is-selected:hover { background: #f1f6fb; }
.users-table tbody tr[data-user]:focus-visible { outline: 2px solid #1a4c81; outline-offset: -2px; }
.users-table tbody.is-loading { opacity: 0.55; }
.users-table td.users-empty { padding: 1.75rem 1rem; text-align: center; color: #6c757d; }
.users-foot { padding: 0.55rem 1rem; border-top: 1px solid #eef0f2; font-size: 0.8rem; color: #6c757d; }
.users-foot:empty { display: none; }

.u-person { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.u-avatar { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: #eaf1f8; color: #1a4c81; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; }
.u-avatar.is-lg { width: 2.75rem; height: 2.75rem; font-size: 0.95rem; }
.u-name { font-weight: 600; color: #1f2933; white-space: nowrap; }
.u-handle { font-weight: 400; color: #8a929a; font-size: 0.8rem; margin-left: 0.2rem; }
.u-contact { font-size: 0.78rem; color: #6c757d; margin-top: 1px; white-space: nowrap; }
.users-table tr.is-off .u-name { color: #6c757d; }
.users-table tr.is-off .u-avatar { background: #f1f3f5; color: #8a929a; }
.u-faint { color: #a3aab1; }
.u-role { color: #495057; }
.u-access { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.users-table .u-access + .u-contact { margin-top: 3px; }
.uf-field > .uf-switch { display: flex; margin-top: 0.8rem; }
.u-chip { display: inline-flex; align-items: center; padding: 0.08rem 0.5rem; border-radius: 999px; border: 1px solid #e3e7eb; background: #f8f9fa; color: #495057; font-size: 0.72rem; line-height: 1.5; white-space: nowrap; }
.u-chip.is-owner { background: #eaf1f8; border-color: #d3e0ee; color: #1a4c81; font-weight: 600; }
.u-chip.is-verify { background: #eef8fa; border-color: #d2ebf0; color: #0f6674; }
.u-chip.is-bad { background: #fdf5f4; border-color: #f3dcd9; color: #9a2a1e; }
.u-status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: #495057; white-space: nowrap; }
.u-status i { width: 7px; height: 7px; border-radius: 50%; background: #0ca30c; }
.u-status.is-off { color: #9a2a1e; }
.u-status.is-off i { background: #b42318; }
.u-status.is-pending i { background: #d9a23c; }

/* Side panel */
.user-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(16, 36, 60, 0.32); }
.user-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(34rem, 100vw); background: #fff; border-left: 1px solid #dee2e6; box-shadow: -18px 0 48px rgba(26, 76, 129, 0.14); overscroll-behavior: contain; animation: user-drawer-in 0.18s ease-out; }
.user-scrim.hidden, .user-drawer.hidden, .drawer-pane.hidden { display: none; }
.drawer-pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.drawer-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 1.1rem 1.25rem 0.9rem; border-bottom: 1px solid #eef0f2; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 1.1rem 1.25rem 1.5rem; }
.drawer-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.8rem 1.25rem; border-top: 1px solid #eef0f2; background: #fbfcfd; }
.drawer-x { flex: none; width: 2rem; height: 2rem; border: 0; border-radius: 0.55rem; background: transparent; color: #6c757d; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.drawer-x:hover { background: #f1f3f5; color: #1f2933; }
@keyframes user-drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .user-drawer { animation: none; } }

.uv-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.uv-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1rem; margin-top: 1.1rem; font-size: 0.875rem; }
.uv-dl dt { font-size: 0.75rem; color: #6c757d; }
.uv-dl dd { margin-top: 0.2rem; color: #1f2933; overflow-wrap: anywhere; }

/* Account form */
.uf-section + .uf-section, .uv-dl + span + .uf-section { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid #eef0f2; }
.uf-grid { display: grid; grid-template-columns: 1fr; gap: 0.9rem 1rem; }
@media (min-width: 520px) { .uf-grid { grid-template-columns: 1fr 1fr; } }
.uf-wide { grid-column: 1 / -1; }
.uf-field { display: block; font-size: 0.8rem; font-weight: 500; color: #495057; }
.uf-field.hidden { display: none; }
.uf-field > input, .uf-field > select, .uf-pass input { display: block; width: 100%; height: 2.4rem; margin-top: 0.35rem; padding: 0 0.7rem; border: 1px solid #dee2e6; border-radius: 0.6rem; font-size: 0.9rem; font-weight: 400; color: #1f2933; background: #fff; outline: none; }
.uf-pass { display: flex; gap: 0.4rem; margin-top: 0.35rem; }
.uf-pass input { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.uf-pass .users-btn { height: 2.4rem; }
.uf-hint { margin-top: 0.4rem; font-size: 0.75rem; font-weight: 400; line-height: 1.45; color: #6c757d; }

.uf-switch { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.875rem; font-weight: 400; color: #1f2933; cursor: pointer; }
.uf-switch input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 2.1rem; height: 1.2rem; margin: 0; border-radius: 999px; background: #ced4da; cursor: pointer; transition: background 0.15s ease; }
.uf-switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: calc(1.2rem - 4px); height: calc(1.2rem - 4px); border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s ease; }
.uf-switch input:checked { background: #1a4c81; }
.uf-switch input:checked::after { transform: translateX(0.9rem); }
.uf-switch input:focus-visible { outline: 2px solid #1a4c81; outline-offset: 2px; }

.uf-picks { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.uf-pick { position: relative; cursor: pointer; }
.uf-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.uf-pick span { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.32rem 0.75rem 0.32rem 0.6rem; border: 1px solid #dee2e6; border-radius: 999px; background: #fff; color: #495057; font-size: 0.82rem; user-select: none; }
.uf-pick span::before { content: ''; width: 0.8rem; height: 0.8rem; border-radius: 50%; border: 1.5px solid #c3cad2; }
.uf-pick:hover span { border-color: #b8c7d8; }
.uf-pick input:checked + span { background: #eaf1f8; border-color: #b9cde3; color: #1a4c81; font-weight: 500; }
.uf-pick input:checked + span::before { border-color: #1a4c81; background: #1a4c81; box-shadow: inset 0 0 0 2px #eaf1f8; }
.uf-pick input:focus-visible + span { outline: 2px solid #1a4c81; outline-offset: 2px; }

.uf-fac-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-top: 0.7rem; }
.uf-fac-tools input { flex: 1 1 9rem; min-width: 0; height: 2rem; padding: 0 0.6rem; border: 1px solid #dee2e6; border-radius: 0.55rem; font-size: 0.82rem; outline: none; }
#userFacilityBox { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.3rem 0.75rem; max-height: 15rem; margin-top: 0.5rem; padding: 0.55rem 0.7rem; overflow: auto; border: 1px solid #dee2e6; border-radius: 0.6rem; }
.uf-fac { display: flex; align-items: center; gap: 0.45rem; font-size: 0.84rem; color: #1f2933; cursor: pointer; min-width: 0; }
.uf-fac.hidden { display: none; }
.uf-fac span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Users: summary cards and pager (small, calm; an alert is a faint tint and a muted dot) */
.users-cards { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.75rem; }
.users-cards:empty { display: none; }
.uc-card { flex: 0 1 180px; min-width: 150px; display: flex; flex-direction: column; gap: 0.2rem; padding: 0.55rem 0.8rem; text-align: left; border: 1px solid #e9ecef; border-radius: 0.75rem; background: #fff; cursor: pointer; }
.uc-card.is-static, .uc-card:disabled { cursor: default; }
.uc-card:not(.is-static):not(:disabled):hover { border-color: #cfd8e3; }
.uc-card.is-alert { background: #fdfaf9; border-color: #f1e4e1; }
.uc-card.is-open { border-color: #9fb6d0; box-shadow: 0 0 0 3px rgba(26, 76, 129, 0.08); }
.uc-card:focus-visible { outline: 2px solid #1a4c81; outline-offset: 2px; }
.uc-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: #8a929a; white-space: nowrap; }
.uc-label i { width: 6px; height: 6px; border-radius: 50%; background: #c98a80; }
.uc-value { font-size: 1.15rem; font-weight: 400; color: #1f2933; font-variant-numeric: tabular-nums; line-height: 1.3; }
.uc-value small { margin-left: 0.4rem; font-size: 0.7rem; color: #a3aab1; }
.uc-panel { margin-bottom: 0.75rem; padding: 0.7rem 0.9rem; border: 1px solid #e9ecef; border-radius: 0.75rem; background: #fff; }
.uc-panel.hidden { display: none; }
.uc-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; font-size: 0.8rem; color: #495057; }
.u-chip.is-link { cursor: pointer; }
.u-chip.is-link:hover { border-color: #b9cde3; background: #eaf1f8; color: #1a4c81; }
.users-select.is-small { height: 1.85rem; padding: 0 0.35rem; font-size: 0.8rem; border-radius: 0.55rem; }
.users-select.is-set { border-color: #b9cde3; background: #eaf1f8; color: #1a4c81; font-weight: 500; }

/* Welcome link, "complete your details" and requests (assets/access.js) */
.jn-card { max-width: 27rem; }
.jn-field { display: block; margin-top: 1.1rem; font-size: 0.8rem; font-weight: 500; color: #495057; }
.jn-field input, .jn-field select { display: block; width: 100%; height: 2.75rem; margin-top: 0.4rem; padding: 0 0.85rem; border: 1px solid #dee2e6; border-radius: 0.75rem; background: #fff; font-size: 0.95rem; font-weight: 400; color: #1f2933; outline: none; }
.jn-field input:focus, .jn-field select:focus { border-color: #17a2b8; box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.12); }
.jn-field input.is-wrong, .jn-field select.is-wrong { border-color: #b42318; }
.jn-hint { display: block; margin-top: 0.35rem; font-size: 0.74rem; font-weight: 400; line-height: 1.45; color: #6c757d; }
.jn-error { margin-top: 1rem; font-size: 0.875rem; color: #b42318; }
.jn-error.hidden { display: none; }
.jn-submit { display: block; width: 100%; margin-top: 1.5rem; padding: 0.75rem 1rem; border: 0; border-radius: 0.75rem; background: #1a4c81; color: #fff; font-size: 0.95rem; letter-spacing: 0.02em; cursor: pointer; transition: background 0.15s ease; }
.jn-submit:hover { background: #17a2b8; }
.jn-submit:disabled { opacity: 0.6; cursor: progress; }
.jn-second { display: block; width: 100%; margin-top: 0.75rem; padding: 0.7rem 1rem; border: 1px solid #dee2e6; border-radius: 0.75rem; background: #fff; color: #6c757d; font-size: 0.875rem; cursor: pointer; }
.jn-second:hover { border-color: #b8c7d8; color: #1a4c81; }
.jn-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 1.1rem; }
.jn-links button { border: 0; background: none; padding: 0; color: #1a4c81; font-size: 0.84rem; cursor: pointer; }
.jn-links button:hover { text-decoration: underline; }
.jn-submit:focus-visible, .jn-second:focus-visible, .jn-links button:focus-visible { outline: 2px solid #1a4c81; outline-offset: 2px; }
.u-acts { display: flex; flex-wrap: nowrap; gap: 0.3rem; margin-top: 0.4rem; }
.users-btn.is-good { border-color: #cfe6cf; color: #0a7a0a; }
.users-btn.is-good:hover { background: #f4faf4; border-color: #a9d3a9; }
.users-btn.is-bad { border-color: #f3dcd9; color: #9a2a1e; }
.users-btn.is-bad:hover { background: #fdf5f4; border-color: #e6bdb7; }
.u-note { margin-top: 0.15rem; font-size: 0.74rem; color: #8a6d1f; white-space: normal; max-width: 26rem; }
.ul-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.55rem; }
.ul-row input { flex: 1 1 16rem; min-width: 0; height: 2.25rem; padding: 0 0.7rem; border: 1px solid #dee2e6; border-radius: 0.6rem; background: #f8f9fa; font-size: 0.84rem; color: #1f2933; outline: none; }
.ul-text { font-size: 0.82rem; line-height: 1.5; color: #495057; }
.jn-combo { position: relative; }
.jn-options { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 0.25rem 0 0; padding: 0.25rem; list-style: none; max-height: 15rem; overflow-y: auto; background: #fff; border: 1px solid #dee2e6; border-radius: 0.75rem; box-shadow: 0 12px 28px rgba(26, 76, 129, 0.14); }
.jn-options.hidden { display: none; }
.jn-options li { padding: 0.5rem 0.7rem; border-radius: 0.5rem; font-size: 0.9rem; font-weight: 400; color: #1f2933; cursor: pointer; }
.jn-options li:hover, .jn-options li.is-active { background: #eaf1f8; color: #1a4c81; }
.jn-options li.is-empty { color: #6c757d; cursor: default; background: none; }
.jn-links button.hidden { display: none; }
.jn-field.hidden { display: none; }

/* ---------- One-facility accounts: no district filter, facility search or facility list ---------- */
.module-tab { white-space: nowrap; flex: none; }
body.is-single-facility .fp-head, body.is-single-facility .fp-toggle { display: none; }
body.is-single-facility .fp-body { display: flex; }
body.is-single-facility.is-cbhi-tab #boardLayout > aside,
body.is-single-facility.is-cbhi-tab .cbhi-toolbar { display: none; }
body.is-single-facility.is-cbhi-tab #boardLayout { grid-template-columns: minmax(0, 1fr); }

/* ---------- Phone: compact header, tabs on one line, more room for the page ---------- */
@media (max-width: 640px) {
  #appView > header + div { padding: .3rem .8rem; font-size: .78rem; }
  #boardLayout { padding-left: .6rem; padding-right: .6rem; gap: .6rem; }
  .cbhi-frame { border-radius: .8rem; }
  /* One facility: the page fills the screen under the header, so only the page itself scrolls. */
  body.is-single-facility.is-cbhi-tab #appView > header + div { display: none; }
  body.is-single-facility.is-cbhi-tab #boardLayout { padding: 0; }
  body.is-single-facility.is-cbhi-tab .cbhi-frame { display: block; height: calc(100dvh - var(--frame-top, 6.5rem)); min-height: 0; border: 0; border-radius: 0; }
}

/* ---------- Language switch (EN / FR) ---------- */
.lang-switch { display: inline-flex; border: 1px solid rgba(255, 255, 255, .25); border-radius: .5rem; overflow: hidden; }
.lang-switch button { appearance: none; border: 0; background: transparent; color: rgba(255, 255, 255, .7); font-size: .78rem; font-weight: 600; letter-spacing: .04em; padding: .42rem .6rem; cursor: pointer; }
.lang-switch button + button { border-left: 1px solid rgba(255, 255, 255, .25); }
.lang-switch button.is-on { background: rgba(255, 255, 255, .92); color: #1a4c81; }
.lang-row { display: flex; justify-content: flex-end; margin-bottom: .5rem; }
.lang-row .lang-switch { border-color: #cbd5e1; }
.lang-row .lang-switch button { color: #52514e; }
.lang-row .lang-switch button + button { border-left-color: #cbd5e1; }
.lang-row .lang-switch button.is-on { background: #1a4c81; color: #fff; }
@media (max-width: 640px) { .lang-switch button { padding: .35rem .5rem; } }

/* ==== Header v2 (2026-11-29): one slim bar. Brand, modules, then period, language and account on the right.
   The period fields and the account actions open in small panels instead of sitting in the bar. ==== */
.hd { position: relative; z-index: 30; background: #1a4c81; color: #fff; }
.hd-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.5rem; min-height: 3.5rem; padding: 0 2rem; }
.hd-brand { flex: none; display: flex; align-items: center; gap: .7rem; padding: .55rem 0; }
.hd-brand img { height: 2rem; width: auto; background: #fff; border-radius: .45rem; padding: .2rem .4rem; }
.hd-brand h1 { font-size: 1.5rem; line-height: 1; letter-spacing: .005em; }
.hd-tabs { flex: 1 1 0; min-width: 0; align-self: stretch; display: flex; gap: .1rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.hd-tabs::-webkit-scrollbar { display: none; }
.hd-tabs .module-tab { display: inline-flex; align-items: center; margin-bottom: 0; padding: 0 .85rem; border-top: 2px solid transparent; border-radius: 0; transition: color .12s ease, background .12s ease; }
.hd-tabs .module-tab.hidden { display: none; }
.hd-tabs .module-tab:hover { background: rgba(255, 255, 255, .06); }
.hd-tabs .module-tab.is-active { font-weight: 600; background: rgba(255, 255, 255, .08); }
.hd-tabs .module-tab:focus-visible, .hd-btn:focus-visible, .hd .lang-switch button:focus-visible { outline: 2px solid #9ce3ec; outline-offset: -2px; }
.hd-tools { flex: none; display: flex; align-items: center; gap: .5rem; margin-left: auto; padding: .55rem 0; }
.hd-pop-wrap { position: relative; }
.hd-btn { display: inline-flex; align-items: center; gap: .45rem; height: 2.25rem; padding: 0 .7rem; border: 1px solid rgba(255, 255, 255, .22); border-radius: .55rem; background: rgba(255, 255, 255, .06); color: #fff; font-size: .85rem; white-space: nowrap; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.hd-btn:hover, .hd-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .38); }
.hd-btn svg { flex: none; opacity: .8; }
.hd-caret { transition: transform .12s ease; }
.hd-btn[aria-expanded="true"] .hd-caret { transform: rotate(180deg); }
.hd-account { padding-left: .3rem; }
.hd-avatar { flex: none; display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #1a4c81; font-size: .68rem; font-weight: 700; letter-spacing: .02em; }
.hd-account-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.hd .lang-switch { height: 2.25rem; border-radius: .55rem; }
.hd .lang-switch button { padding: 0 .6rem; }

.hd-pop { position: absolute; top: calc(100% + .5rem); right: 0; z-index: 50; background: #fff; color: #1f2933; border: 1px solid #dee2e6; border-radius: .8rem; box-shadow: 0 16px 40px rgba(16, 36, 60, .18); }
.hd-pop[hidden] { display: none; }
.hd-period { display: grid; gap: .75rem; width: 19rem; padding: .95rem; }
.hd-field { display: grid; gap: .3rem; min-width: 0; font-size: .75rem; font-weight: 500; color: #5b6570; }
.hd-field input, .hd-field select { width: 100%; min-width: 0; height: 2.4rem; padding: 0 .6rem; border: 1px solid #d5dbe3; border-radius: .55rem; background: #fff; font-size: .9rem; font-weight: 400; color: #1f2933; outline: none; }
.hd-field input:focus, .hd-field select:focus { border-color: #1a4c81; box-shadow: 0 0 0 3px rgba(26, 76, 129, .12); }
.hd-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.hd-apply { height: 2.4rem; border: 0; border-radius: .55rem; background: #1a4c81; color: #fff; font-size: .9rem; font-weight: 500; cursor: pointer; }
.hd-apply:hover { background: #163f6b; }
.hd-apply:focus-visible, .hd-menu-item:focus-visible { outline: 2px solid #1a4c81; outline-offset: 2px; }
.hd-menu { display: grid; gap: .1rem; min-width: 13.5rem; padding: .4rem; }
.hd-menu-who { display: grid; gap: .1rem; margin: 0 0 .3rem; padding: .5rem .65rem .6rem; border-bottom: 1px solid #eef0f2; }
.hd-menu-who b { font-size: .9rem; font-weight: 600; color: #1f2933; overflow-wrap: anywhere; }
.hd-menu-who span { font-size: .76rem; color: #6c757d; text-transform: capitalize; }
.hd-menu-item { display: block; width: 100%; padding: .55rem .65rem; border: 0; border-radius: .5rem; background: none; text-align: left; font-size: .875rem; color: #1f2933; text-decoration: none; cursor: pointer; }
.hd-menu-item.hidden { display: none; }
.hd-menu-item:hover { background: #f1f5f9; }
.hd-menu-item.is-out { color: #9a2a1e; }
@media (prefers-reduced-motion: reduce) { .hd-btn, .hd-caret, .hd-tabs .module-tab { transition: none; } }

/* Medium screens: the modules drop to their own row under the bar. */
@media (max-width: 1279px) {
  .hd-tabs { order: 3; flex: 1 1 100%; align-self: auto; margin: 0 -2rem; padding: 0 1.6rem; border-top: 1px solid rgba(255, 255, 255, .1); }
  .hd-tabs .module-tab { padding: .65rem .85rem; border-top: 0; }
}
/* Phone: tighter bar, the account shows as initials only, panels span the screen. */
@media (max-width: 640px) {
  .hd-bar { min-height: 3rem; padding: 0 .8rem; gap: 0 .6rem; }
  .hd-brand { gap: .55rem; padding: .45rem 0; }
  .hd-brand img { height: 1.75rem; }
  .hd-brand h1 { font-size: 1.25rem; }
  .hd-tools { gap: .35rem; padding: .45rem 0; }
  .hd-tabs { margin: 0 -.8rem; padding: 0 .35rem; }
  .hd-tabs .module-tab { padding: .6rem .75rem; }
  .hd-account { padding: 0 .3rem; }
  .hd-account-name, .hd-account .hd-caret { display: none; }
  .hd-btn { padding: 0 .55rem; }
  .hd-pop-wrap { position: static; }
  .hd-pop { left: .6rem; right: .6rem; top: 3.1rem; }
  .hd-period { width: auto; }
  .hd-field input, .hd-field select, .hd-apply { height: 2.75rem; font-size: 1rem; }
  .hd-menu-item { padding: .75rem .65rem; }
}
@media (max-width: 380px) { .hd-brand h1 { display: none; } }

/* ==== Health-facility list v2 (2026-11-29) ====
   Search and district stay in view while the list scrolls; districts fold; the chosen centre is a soft tint
   (no stripe). Below 1024px the list folds into one button that names the current choice. */
.fp { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid #e3e7ec; border-radius: .9rem; overflow: hidden; }
.fp-toggle { display: none; align-items: center; gap: .65rem; width: 100%; min-height: 3rem; padding: .45rem .85rem; border: 0; background: #fff; color: #1a4c81; text-align: left; cursor: pointer; }
.fp-toggle-text { flex: 1 1 auto; min-width: 0; display: grid; }
.fp-toggle-text small { font-size: .72rem; color: #6c757d; }
.fp-toggle-text b { font-size: .95rem; font-weight: 600; color: #1f2933; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-caret { flex: none; color: #6c757d; transition: transform .12s ease; }
.fp.is-open .fp-caret { transform: rotate(180deg); }
.fp-toggle:focus-visible { outline: 2px solid #1a4c81; outline-offset: -2px; }
.fp-body { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.fp-head { flex: none; display: grid; gap: .45rem; padding: .8rem .75rem .65rem; border-bottom: 1px solid #eef0f2; }
.fp-title { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin: 0 .1rem .1rem; font-size: .8rem; font-weight: 600; color: #1f2933; }
.fp-title b { font-weight: 500; font-size: .75rem; color: #6c757d; font-variant-numeric: tabular-nums; }
.fp-search { position: relative; display: block; }
.fp-search svg { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: #8a929a; pointer-events: none; }
.fp-search input, .fp-district select { display: block; width: 100%; height: 2.15rem; border: 1px solid #dee2e6; border-radius: .6rem; background: #fff; font-size: .84rem; color: #1f2933; outline: none; }
.fp-search input { padding: 0 .6rem 0 2rem; }
.fp-district select { padding: 0 .5rem; }
.fp-search input:focus, .fp-district select:focus { border-color: #1a4c81; box-shadow: 0 0 0 3px rgba(26, 76, 129, .12); }
.fp-chip { justify-self: start; display: inline-flex; align-items: center; gap: .4rem; height: 1.75rem; padding: 0 .35rem 0 .6rem; border: 1px solid #e3e7ec; border-radius: 999px; background: #fff; color: #495057; font-size: .78rem; cursor: pointer; }
.fp-chip[hidden] { display: none; }
.fp-chip i { width: 6px; height: 6px; border-radius: 50%; background: #d08a83; }
.fp-chip b { min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: #f1f3f5; font-size: .72rem; font-weight: 600; line-height: 1.25rem; text-align: center; font-variant-numeric: tabular-nums; }
.fp-chip:hover { border-color: #cfd8e3; }
.fp-chip[aria-pressed="true"] { background: #fdf8f7; border-color: #ecd3cf; color: #9a2a1e; }
.fp-chip[aria-pressed="true"] b { background: #f6e3e0; color: #9a2a1e; }
.fp-chip:focus-visible, .fp-group:focus-visible, .fp .rail-btn:focus-visible { outline: 2px solid #1a4c81; outline-offset: -2px; }
.fp-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .4rem .45rem .6rem; overscroll-behavior: contain; scrollbar-width: thin; }
.fp .rail-btn { display: flex; align-items: center; gap: .55rem; width: 100%; min-height: 1.9rem; padding: .25rem .6rem; border: 0; border-radius: .5rem; background: transparent; color: #33404d; font-size: .84rem; line-height: 1.25; text-align: left; cursor: pointer; }
.fp .rail-btn:hover { background: #f4f6f8; }
.fp .rail-btn.is-selected, .fp .rail-btn.is-selected:hover { background: #eaf1f8; color: #1a4c81; font-weight: 600; }
.fp-all { margin-bottom: .2rem; font-weight: 500; }
.fp-all svg { flex: none; color: #6c8bab; }
.fp-all b { margin-left: auto; font-size: .75rem; font-weight: 500; color: #6c757d; font-variant-numeric: tabular-nums; }
.fp-group { position: sticky; top: -.4rem; z-index: 1; display: flex; align-items: center; gap: .4rem; width: 100%; margin-top: .35rem; padding: .4rem .6rem .3rem; border: 0; background: #fff; color: #5b6570; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-align: left; cursor: pointer; }
.fp-group svg { flex: none; color: #9aa1a9; transition: transform .12s ease; }
.fp-group[aria-expanded="false"] svg { transform: rotate(-90deg); }
.fp-group b { margin-left: auto; font-weight: 500; letter-spacing: 0; color: #8a929a; font-variant-numeric: tabular-nums; }
.fp-group:hover { color: #1a4c81; }
.fp-empty { margin: .9rem .6rem; font-size: .82rem; color: #6c757d; }
@media (prefers-reduced-motion: reduce) { .fp-caret, .fp-group svg { transition: none; } }

/* Wide screens: the panel stays beside the page and scrolls on its own. */
@media (min-width: 1024px) {
  .fp { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); }
}
/* Tablets and phones: one button; the list opens under it and closes after a choice. */
@media (max-width: 1023px) {
  .fp-toggle { display: flex; }
  .fp-body { display: none; border-top: 1px solid #eef0f2; }
  .fp.is-open .fp-body { display: flex; }
  .fp-list { max-height: 55vh; }
  .fp .rail-btn { min-height: 2.6rem; font-size: .92rem; }
  .fp-search input, .fp-district select { height: 2.6rem; font-size: 1rem; }
  .fp-chip { height: 2.1rem; }
  .fp-group { padding-top: .6rem; padding-bottom: .45rem; font-size: .74rem; }
}
/* In the list a steady dot is enough: with many centres active, the pulse was restless. */
.fp .live-dot { animation: none; }
@media (max-width: 1023px) { .fp-title { display: none; } }

/* Folding the whole list away (wide screens): a narrow strip stays, naming the current choice. */
.fp-title { align-items: center; }
.fp-title span { margin-right: auto; }
.fp-icon { flex: none; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; margin: -.2rem -.25rem -.2rem 0; border: 0; border-radius: .45rem; background: transparent; color: #6c757d; cursor: pointer; }
.fp-icon:hover { background: #f1f3f5; color: #1a4c81; }
.fp-icon:focus-visible, .fp-expand:focus-visible { outline: 2px solid #1a4c81; outline-offset: -2px; }
.fp-expand { display: none; }
@media (min-width: 1024px) {
  body.is-rail-collapsed:not(.is-single-facility) #boardLayout { grid-template-columns: 2.75rem minmax(0, 1fr); }
  body.is-rail-collapsed:not(.is-single-facility) .fp-body { display: none; }
  body.is-rail-collapsed:not(.is-single-facility) .fp-expand { display: flex; flex-direction: column; align-items: center; gap: .7rem; width: 100%; padding: .8rem 0 1rem; border: 0; background: #fff; color: #1a4c81; cursor: pointer; }
  body.is-rail-collapsed:not(.is-single-facility) .fp-expand:hover { background: #f4f6f8; }
  .fp-expand span { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; font-weight: 600; color: #33404d; }
}
@media (max-width: 1023px) { .fp-icon { display: none; } }

/* Folded strip, made easier to see: brand tint, larger name, and the number of centres. */
@media (min-width: 1024px) {
  body.is-rail-collapsed:not(.is-single-facility) #boardLayout { grid-template-columns: 3.25rem minmax(0, 1fr); }
  body.is-rail-collapsed:not(.is-single-facility) .fp { border-color: #c9d9ea; }
  body.is-rail-collapsed:not(.is-single-facility) .fp-expand { gap: .8rem; padding: .7rem 0 .9rem; background: #eaf1f8; }
  body.is-rail-collapsed:not(.is-single-facility) .fp-expand:hover { background: #dde9f5; }
  .fp-expand svg { box-sizing: content-box; padding: .35rem; border-radius: 50%; background: #1a4c81; color: #fff; }
  .fp-expand span { font-size: .95rem; font-weight: 700; letter-spacing: .01em; color: #1a4c81; }
  .fp-expand b { min-width: 1.9rem; padding: .15rem .4rem; border-radius: 999px; background: #1a4c81; color: #fff; font-size: .78rem; font-weight: 600; line-height: 1.4; text-align: center; font-variant-numeric: tabular-nums; }
  .fp-expand b:empty { display: none; }
}

/* Folded strip: how many centres and how many districts, each number named. */
.fp-stats { display: grid; justify-items: center; gap: .1rem; font-style: normal; }
.fp-stats[hidden] { display: none; }
.fp-stats small { margin-bottom: .45rem; font-size: .62rem; font-weight: 500; letter-spacing: .02em; color: #5b6570; }
.fp-stats small:last-child { margin-bottom: 0; }
.fp-stats b.is-soft { background: #fff; color: #1a4c81; box-shadow: inset 0 0 0 1px #b9cde3; }

/* ==== Usage page v2 (2026-11-29) ====
   Order: headline cards, then the trend beside the centres that need attention, then services, then rankings
   and the table. Ranking charts use one colour and carry their values; colour is kept for status. */
.net-top, .net-bottom { display: grid; gap: .75rem; margin-top: .6rem; align-items: stretch; }
.net-bottom { align-items: start; }
.net-top > *, .net-bottom > * { min-width: 0; }
@media (min-width: 1100px) {
  .net-top { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  .net-top:has(> .net-attn.hidden) { grid-template-columns: minmax(0, 1fr); }
  .net-bottom { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}
.net-top .chart-frame { height: 250px; }
.net-attn { display: flex; flex-direction: column; min-height: 0; }
.net-attn.hidden { display: none; }
.net-attn-head { display: flex; align-items: baseline; gap: .5rem; }
.net-attn-count { padding: 0 .5rem; border-radius: 999px; background: #fdf5f4; border: 1px solid #f3dcd9; color: #9a2a1e; font-size: .75rem; font-weight: 600; line-height: 1.35rem; font-variant-numeric: tabular-nums; }
.net-attn-count:empty { display: none; }
.net-attn-list { list-style: none; margin: 0 -.4rem; padding: 0; flex: 1 1 auto; min-height: 0; max-height: 250px; overflow-y: auto; scrollbar-width: thin; }
.net-attn-list li + li { border-top: 1px solid #f0f2f4; }
.net-attn-list button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .15rem .6rem; width: 100%; padding: .45rem .4rem; border: 0; border-radius: .5rem; background: none; text-align: left; cursor: pointer; }
.net-attn-list button:hover { background: #f6f8fa; }
.net-attn-list button:focus-visible { outline: 2px solid #1a4c81; outline-offset: -2px; }
.net-attn-list i { width: 7px; height: 7px; border-radius: 50%; background: #b42318; }
.net-attn-list i.is-down { background: #a8a29e; }
.net-attn-who { min-width: 0; display: grid; }
.net-attn-who b { font-size: .86rem; font-weight: 600; color: #1f2933; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-attn-who small { font-size: .74rem; color: #6c757d; }
.net-attn-why { font-size: .78rem; color: #52514e; white-space: nowrap; }
.net-attn-list svg { color: #b3bcc6; }
.net-attn-list button:hover svg { color: #1a4c81; }
.net-attn-ok { display: flex; align-items: center; gap: .6rem; padding: .8rem .4rem; font-size: .86rem; color: #495057; }
.net-attn-list .net-attn-ok i { background: #0ca30c; }
#nhSilentCard.is-alert { cursor: pointer; }
#nhSilentCard.is-alert:hover { border-color: #e9cfcb; }

/* Service tiles: as many per row as fit at a readable width, instead of a fixed eight. */
#networkMetricGrid.usage-grid { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }
.usage-unused { margin: .5rem .15rem 0; font-size: 12px; color: #6c757d; }
.usage-unused.hidden { display: none; }
.usage-unused span { color: #8a929a; }

/* e-Transfer: shared against not shared as one bar; the long list of centres stays on one line. */
.transfer-bar { flex: none; width: 120px; height: 6px; border-radius: 3px; background: #e8b7b1; overflow: hidden; }
.transfer-bar.hidden { display: none; }
.transfer-bar i { display: block; height: 100%; background: #0ca30c; border-right: 2px solid #fff; }
#transferShareNote { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Health-centre table below tablet width: the name stays in view, secondary columns are left out. */
@media (max-width: 860px) {
  .fac-table .fac-opt { display: none; }
  .fac-table th:first-child, .fac-table td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 #eef0f2; }
  .fac-table thead th:first-child { z-index: 2; background: #f8f9fa; }
  .fac-table .fac-group td:first-child { background: #eef3f8; }
  .fac-table tr.is-zero td:first-child { background: #fdf5f5; }
  .fac-name { max-width: 46vw; }
  .fac-toolbar > p { display: none; }
}
@media (max-width: 640px) {
  .net-top .chart-frame { height: 210px; }
  .fac-table th, .fac-table td { padding-left: 8px; padding-right: 8px; }
  .transfer-bar { width: 90px; }
  #transferShareNote { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* ==== Single health-centre page v2 (2026-11-30) ====
   Same parts as the Usage page: small calm figures beside the name, tiles wide enough for their labels,
   ranked services carrying their values. */
.dv-back { display: inline-flex; align-items: center; gap: .3rem; margin: 0 0 .55rem -.35rem; padding: .25rem .6rem .25rem .35rem; border: 0; border-radius: .5rem; background: none; color: #1a4c81; font-size: .84rem; font-weight: 500; cursor: pointer; }
.dv-back:hover { background: #eaf1f8; }
.dv-back:focus-visible { outline: 2px solid #1a4c81; outline-offset: 1px; }
.dv-head .nh-title { min-width: 0; }
.dv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-top: .65rem; font-size: .84rem; color: #6c757d; }
.dv-status { display: inline-flex; align-items: center; gap: .4rem; padding: .1rem .6rem .1rem .5rem; border: 1px solid #e3e7ec; border-radius: 999px; background: #fff; color: #33404d; font-size: .78rem; font-weight: 500; white-space: nowrap; }
.dv-status i { width: 7px; height: 7px; border-radius: 50%; }
.dv-stats { grid-template-columns: repeat(auto-fit, minmax(138px, 190px)); }
.dv-stats .nh-row b { white-space: nowrap; }
@media (max-width: 1100px) { .dv-stats { justify-content: start; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
@media (max-width: 640px) { .dv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#metricGrid.usage-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
#metricGrid .usage-label { white-space: normal; overflow: visible; }
@media (max-width: 640px) { #metricGrid.usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#detailView .transfer-line { flex-wrap: wrap; }
