:root {
  --app-bg: #eef3f5;
  --app-surface: #ffffff;
  --app-border: #d8e0e5;
  --app-text: #173042;
  --app-muted: #65808f;
  --app-accent: #0f6b78;
  --app-accent-dark: #0a5160;
  --app-highlight: #d8edf0;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--app-text);
  background:
    radial-gradient(circle at top right, rgba(15, 107, 120, 0.06), transparent 30%),
    linear-gradient(180deg, #f6fafb 0%, var(--app-bg) 100%);
}

h1, h2, h3, h4, h5, h6, .brand-title, .brand-eyebrow, .nav-pill, .kpi-value, .detail-label, .table thead th, .badge {
  font-family: "IBM Plex Mono", monospace;
}

.bg-app { min-height: 100vh; }
.app-header { backdrop-filter: blur(14px); background: rgba(255, 255, 255, 0.9); }
.brand-eyebrow { font-size: 0.72rem; letter-spacing: 0.12em; color: var(--app-muted); }
.brand-title { font-size: 1rem; font-weight: 600; color: var(--app-text); }
.app-brand-logo {
  display: inline-flex;
  align-items: center;
  margin-right: 0.35rem;
  padding: 0;
}
.app-navbar-logo {
  display: block;
  width: clamp(9rem, 12vw, 13rem);
  height: auto;
}
.login-brand {
  text-align: center;
}
.login-logo {
  display: block;
  width: min(20rem, 82vw);
  height: auto;
  margin: 0 auto;
}
.text-accent { color: var(--app-accent); }
.nav-pill { border: 1px solid transparent; border-radius: 999px; padding: 0.55rem 1rem !important; color: var(--app-muted); }
.nav-pill.active, .nav-pill:hover { background: var(--app-highlight) !important; border-color: rgba(15, 107, 120, 0.18); color: var(--app-accent) !important; }
.app-main-nav {
  min-width: 0;
}
.app-header-actions {
  flex: 0 0 auto;
}
.nav-pill .bi,
.btn .bi,
.dropdown-item .bi {
  line-height: 1;
  vertical-align: -0.1em;
}
.user-menu-toggle {
  color: var(--app-text);
  text-decoration: none;
}
.user-menu-toggle:hover,
.user-menu-toggle:focus {
  color: var(--app-accent);
  text-decoration: none;
}
.user-menu-caret::after {
  content: "";
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  margin-left: 0.35rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.12rem) rotate(45deg);
}
.user-menu-icon {
  color: var(--app-accent);
  font-size: 1.15rem;
}
.hero-panel { background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(216, 237, 240, 0.9)); border: 1px solid var(--app-border); border-radius: 1.5rem; padding: 2rem; box-shadow: 0 20px 40px rgba(19, 48, 66, 0.06); }
.shadow-app { box-shadow: 0 18px 40px rgba(16, 44, 60, 0.08) !important; }
.border-app { border-color: var(--app-border) !important; }
.kpi-card { background: rgba(255, 255, 255, 0.85); border: 1px solid var(--app-border); border-radius: 1rem; padding: 1rem; }
.kpi-label { color: var(--app-muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; }
.kpi-value { font-size: 2rem; font-weight: 600; }
.patient-sidebar { position: sticky; top: 6.5rem; }
.actions-vertical {
  min-width: 5.75rem;
  gap: 0.45rem !important;
}
.actions-vertical .btn {
  min-width: 5.75rem;
  padding: 0.22rem 0.55rem;
  font-size: 0.74rem;
  line-height: 1.2;
  border-radius: 0.55rem;
}
.actions-vertical form .btn {
  min-width: 5.75rem;
}
.detail-card { background: #f8fbfc; border: 1px solid var(--app-border); border-radius: 1rem; padding: 1rem; height: 100%; }
.detail-label { font-size: 0.78rem; color: var(--app-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.35rem; }
.detail-value { font-size: 1rem; font-weight: 600; line-height: 1.35; }
.uti-card { cursor: pointer; }
.uti-card-watch {
  border: 1px solid #d33f49 !important;
  box-shadow: 0 18px 40px rgba(151, 32, 41, 0.16) !important;
}
.uti-watch-badge {
  position: absolute;
  top: -0.72rem;
  left: 1.25rem;
  z-index: 3;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #c92f3d;
  color: #ffffff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 0.38rem 0.7rem;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(151, 32, 41, 0.22), 0 0 0 rgba(201, 47, 61, 0);
  animation: watch-neon-pulse 2.4s ease-in-out infinite;
}
@keyframes watch-neon-pulse {
  0%, 100% {
    background: #c92f3d;
    box-shadow: 0 8px 18px rgba(151, 32, 41, 0.22), 0 0 0 rgba(201, 47, 61, 0);
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  45% {
    background: #f04452;
    box-shadow: 0 10px 24px rgba(151, 32, 41, 0.3), 0 0 18px rgba(240, 68, 82, 0.85), 0 0 34px rgba(240, 68, 82, 0.45);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.72);
  }
}
@media (min-width: 992px) {
  .app-header .navbar-collapse {
    min-width: 0;
  }
  .app-main-nav {
    flex: 1 1 auto;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }
  .app-main-nav .nav-item {
    flex: 0 0 auto;
  }
  .app-main-nav .nav-pill {
    padding-left: 0.82rem !important;
    padding-right: 0.82rem !important;
    white-space: nowrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .uti-watch-badge {
    animation: none;
  }
}
.uti-card-reviewed { background: #ecfdf3; }
.uti-card > .card-body { min-height: 17rem; position: relative; }
.uti-card-summary { padding-right: 10rem; }
.uti-card-actions { position: absolute; right: 1.5rem; top: 1.5rem; z-index: 2; }
.uti-card .collapse { cursor: default; }
.uti-detail-card { background: #fbfdfe; }
.uti-card-reviewed .uti-detail-card { background: #ffffff; }
.uti-card-toggle { color: var(--app-accent); font-weight: 600; }
.uti-card-toggle .when-expanded { display: inline; }
.uti-card-toggle .when-collapsed { display: none; }
.uti-card-toggle.collapsed .when-expanded { display: none; }
.uti-card-toggle.collapsed .when-collapsed { display: inline; }
.uti-card-toggle-icon::after { content: "-"; display: inline-block; margin-left: 0.25rem; }
.uti-card-toggle.collapsed .uti-card-toggle-icon::after { content: "+"; }
.uti-diagnosis-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
}
.uti-diagnosis-list {
  display: grid;
  gap: 0.38rem;
  max-height: 9.25rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.uti-diagnosis-chip {
  display: block;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #d9e4ea;
  border-radius: 999px;
  background: #ffffff;
  color: #0f2738;
  padding: 0.28rem 0.62rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.uti-diagnosis-edit {
  align-self: end;
  white-space: nowrap;
}
.diagnosis-selector {
  display: grid;
  gap: 1.15rem;
  margin-top: 0.35rem;
  padding: 0.35rem 0.85rem 0.85rem;
}
.diagnosis-group {
  border-top: 1px solid rgba(171, 70, 84, 0.18);
  padding-top: 0.9rem;
}
.diagnosis-group-title {
  color: #ab4654;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}
.diagnosis-option {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.65rem;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  background: transparent;
  padding: 0.2rem 0.45rem;
  margin-bottom: 0.2rem;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.diagnosis-option:hover {
  border-color: rgba(171, 70, 84, 0.1);
  background: rgba(171, 70, 84, 0.035);
  box-shadow: inset 0 0 0 1px rgba(171, 70, 84, 0.04);
}
.diagnosis-option .form-check-input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.diagnosis-option .form-check-label {
  line-height: 1.35;
}
.form-floating > .form-control,
.form-floating > .form-select {
  border-radius: 0.9rem;
}
.choice-stack ul {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.choice-stack label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.uti-card-toolbar {
  margin-bottom: 1rem;
}
.uti-card-reviewed {
  border: 1px solid #9fd3ad !important;
  background: linear-gradient(180deg, #f6fff7, #eefaf0);
}
.uti-card-reviewed .uti-card-content {
  border-top-color: rgba(118, 182, 132, 0.35);
}
.uti-collapse-toggle {
  min-width: 6.5rem;
  flex-shrink: 0;
}
.uti-card-content {
  border-top: 1px solid rgba(216, 224, 229, 0.9);
  padding-top: 1rem;
}
.uti-card-footer {
  border-top: 1px dashed rgba(216, 224, 229, 0.9);
  padding-top: 0.75rem;
  font-size: 0.77rem;
}
.weight-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.weight-trend-inline {
  margin-top: 0;
  margin-left: 0.35rem;
  vertical-align: baseline;
}
.weight-trend-alta {
  color: #1f8b4c;
}
.weight-trend-baixa {
  color: #c44b5c;
}
.weight-trend-estavel {
  color: var(--app-muted);
}
.patient-alert {
  border-color: #efc2c7 !important;
  background: linear-gradient(135deg, #fff8f8, #fff0f1);
}
.patient-alert:not(.active):hover,
.patient-alert:not(.active):focus {
  border-color: #e6a3a8 !important;
  background: linear-gradient(135deg, #fff3f4, #ffe8ea);
}
.list-group-item.active { background: linear-gradient(135deg, var(--app-accent), var(--app-accent-dark)); border-color: transparent !important; }
.card, .accordion-item, .modal-content { border-radius: 1.25rem !important; }
.modal-body-scroll { max-height: calc(100vh - 12rem); overflow-y: auto; }
.btn-primary { background: var(--app-accent); border-color: var(--app-accent); }
.btn-primary:hover, .btn-primary:focus { background: var(--app-accent-dark); border-color: var(--app-accent-dark); }
.table > :not(caption) > * > * { padding-top: 0.85rem; padding-bottom: 0.85rem; }
.toast-container.app-toast-container {
  top: 6.25rem;
  z-index: 1090;
  width: min(28rem, calc(100vw - 2rem));
}
.app-toast {
  width: 100%;
}
.dashboard-shell {
  max-width: 92rem;
}
.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1.35rem 1.45rem;
  border: 1px solid rgba(15, 107, 120, 0.16);
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(226, 247, 251, 0.92), rgba(255, 255, 255, 0.92) 58%, rgba(255, 244, 184, 0.32)),
    #ffffff;
  box-shadow: 0 18px 42px rgba(16, 44, 60, 0.08);
}
.dashboard-title {
  margin: 0;
  color: var(--app-text);
  font-size: clamp(1.75rem, 2.4vw, 2.55rem);
  font-weight: 800;
}
.dashboard-subtitle {
  max-width: 43rem;
  color: var(--app-muted);
}
.dashboard-hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  color: #125364;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
}
.dashboard-status-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: #19c37d;
  box-shadow: 0 0 0 5px rgba(25, 195, 125, 0.16), 0 0 18px rgba(25, 195, 125, 0.38);
}
.dashboard-subnav {
  position: sticky;
  top: 5.2rem;
  z-index: 20;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.45rem;
  overflow-x: auto;
  border: 1px solid var(--app-border);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(16, 44, 60, 0.07);
  backdrop-filter: blur(16px);
}
.dashboard-filterbar {
  display: grid;
  grid-template-columns: minmax(12rem, 1.3fr) minmax(10rem, 1fr) minmax(8rem, 0.8fr) auto auto;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--app-border);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(16, 44, 60, 0.06);
}
.dashboard-filterbar label {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}
.dashboard-filterbar span {
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}
.dashboard-filterbar select {
  width: 100%;
  min-height: 2.45rem;
  border: 1px solid var(--app-border);
  border-radius: 0.65rem;
  background: #ffffff;
  color: var(--app-text);
  padding: 0 0.65rem;
}
.dashboard-filterbar button,
.dashboard-filterbar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.45rem;
  border-radius: 0.65rem;
  padding: 0 0.85rem;
  font-weight: 700;
  text-decoration: none;
}
.dashboard-filterbar button {
  border: 1px solid var(--app-accent);
  background: var(--app-accent);
  color: #ffffff;
}
.dashboard-filterbar a {
  border: 1px solid var(--app-border);
  background: #ffffff;
  color: var(--app-muted);
}
.dashboard-subnav button {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  flex: 0 0 auto;
  padding: 0.56rem 0.75rem;
  border: 0;
  border-radius: 0.65rem;
  color: #244559;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}
.dashboard-subnav button:hover,
.dashboard-subnav button:focus {
  color: var(--app-accent-dark);
  background: rgba(15, 107, 120, 0.09);
  transform: translateY(-1px);
}
.dashboard-subnav button.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--app-accent), var(--app-accent-dark));
  box-shadow: 0 10px 18px rgba(15, 107, 120, 0.18);
}
.dashboard-tab-content {
  min-height: 24rem;
}
.dashboard-tab-content .tab-pane {
  outline: 0;
}
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.dashboard-kpi {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.82rem;
  align-items: start;
  min-height: 8.5rem;
  padding: 1rem;
  border: 1px solid var(--app-border);
  border-radius: 0.95rem;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(16, 44, 60, 0.07);
}
.dashboard-kpi-alert {
  border-color: rgba(255, 23, 77, 0.24);
  background: linear-gradient(135deg, #fff, #fff4f6);
}
.dashboard-kpi-icon {
  display: inline-grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 0.75rem;
  color: var(--app-accent-dark);
  background: rgba(15, 107, 120, 0.1);
}
.dashboard-kpi-alert .dashboard-kpi-icon {
  color: #ba173f;
  background: rgba(255, 23, 77, 0.1);
}
.dashboard-kpi-label,
.dashboard-kpi-note {
  color: var(--app-muted);
  font-size: 0.8rem;
}
.dashboard-kpi-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
.dashboard-kpi-value {
  color: var(--app-text);
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1;
}
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(18rem, 0.85fr);
  gap: 1rem;
}
.dashboard-panel {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.94);
  padding: 1rem;
  box-shadow: 0 18px 40px rgba(16, 44, 60, 0.08);
}
.dashboard-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.dashboard-panel-header h2 {
  margin: 0;
  color: var(--app-text);
  font-size: 1.15rem;
  font-weight: 800;
}
.dashboard-panel-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  color: #244559;
  background: #f3f7f9;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
}
.dashboard-overview-grid,
.dashboard-mini-list {
  display: grid;
  gap: 0.8rem;
}
.dashboard-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dashboard-overview-grid > div,
.dashboard-mini-list > div {
  border: 1px solid #e6edf0;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #ffffff, #fbfdfe);
  padding: 0.9rem;
}
.dashboard-overview-grid span,
.dashboard-mini-list span {
  display: block;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.dashboard-overview-grid strong {
  display: block;
  color: var(--app-text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 2rem;
  line-height: 1.1;
}
.dashboard-overview-grid small {
  color: var(--app-muted);
}
.dashboard-mini-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.dashboard-mini-list strong {
  color: var(--app-text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.35rem;
}
.dashboard-line-chart {
  min-height: 18rem;
  overflow-x: auto;
}
.dashboard-line-chart svg {
  display: block;
  width: 100%;
  min-width: 44rem;
  height: auto;
}
.dashboard-line-area {
  fill: rgba(15, 107, 120, 0.1);
}
.dashboard-line-path {
  fill: none;
  stroke: #0f6b78;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 10px rgba(15, 107, 120, 0.16));
}
.dashboard-line-chart circle {
  fill: #ffffff;
  stroke: #0f6b78;
  stroke-width: 3;
}
.dashboard-line-chart g.is-today circle {
  stroke: #ff174d;
  filter: drop-shadow(0 0 8px rgba(255, 23, 77, 0.45));
}
.dashboard-line-chart text {
  fill: var(--app-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
}
.dashboard-line-chart text + text {
  fill: var(--app-text);
}
.dashboard-bars {
  display: grid;
  grid-template-columns: repeat(14, minmax(2.35rem, 1fr));
  gap: 0.55rem;
  align-items: end;
  min-height: 15rem;
}
.dashboard-bar-item {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 0.25rem;
  min-width: 0;
  height: 15rem;
  color: var(--app-muted);
  text-align: center;
}
.dashboard-bar-track {
  display: flex;
  align-items: end;
  height: 10.75rem;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #f8fbfc, #edf5f7);
  overflow: hidden;
}
.dashboard-bar-fill {
  width: 100%;
  min-height: 0.45rem;
  border-radius: 0.75rem 0.75rem 0 0;
  background: linear-gradient(180deg, #19a0b7, #0f6b78);
  box-shadow: 0 -8px 20px rgba(15, 107, 120, 0.18);
}
.dashboard-bar-item.is-today .dashboard-bar-fill {
  background: linear-gradient(180deg, #ff9f1c, #ff174d);
  box-shadow: 0 -8px 22px rgba(255, 23, 77, 0.28);
}
.dashboard-bar-value {
  color: var(--app-text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  font-weight: 800;
}
.dashboard-bar-label {
  font-size: 0.68rem;
  white-space: nowrap;
}
.dashboard-sector-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
.dashboard-sector-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4rem auto;
  gap: 0.5rem;
  align-items: center;
  border: 1px solid #e6edf0;
  border-radius: 0.72rem;
  background: #fbfdfe;
  padding: 0.62rem 0.7rem;
}
.dashboard-sector-main {
  min-width: 0;
}
.dashboard-sector-main strong,
.dashboard-attention-item strong {
  display: block;
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-sector-main span,
.dashboard-attention-item span,
.dashboard-attention-time span {
  display: block;
  color: var(--app-muted);
  font-size: 0.78rem;
}
.dashboard-sector-meter {
  height: 0.46rem;
  border-radius: 999px;
  background: #edf3f5;
  overflow: hidden;
}
.dashboard-sector-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #65c7d6, #0f6b78);
}
.dashboard-sector-total {
  color: var(--app-text);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 800;
}
.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0.85rem;
}
.dashboard-donut-card,
.dashboard-ranking-card {
  min-width: 0;
  border: 1px solid #e6edf0;
  border-radius: 0.95rem;
  background: linear-gradient(135deg, #ffffff, #fbfdfe);
  padding: 1rem;
}
.dashboard-donut-card {
  display: grid;
  grid-template-columns: minmax(11rem, 0.85fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}
.dashboard-donut-wrap {
  display: grid;
  place-items: center;
}
.dashboard-donut {
  display: grid;
  width: min(14rem, 54vw);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(16, 44, 60, 0.06), 0 14px 30px rgba(16, 44, 60, 0.1);
}
.dashboard-donut > div {
  display: grid;
  width: 52%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(16, 44, 60, 0.12);
}
.dashboard-donut strong {
  color: var(--app-text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 2rem;
  line-height: 1;
}
.dashboard-donut span {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.dashboard-donut-legend,
.dashboard-diagnosis-ranking,
.dashboard-system-list,
.dashboard-clinical-compact {
  display: grid;
  gap: 0.5rem;
}
.dashboard-donut-legend > div,
.dashboard-diagnosis-ranking > div,
.dashboard-system-list > div,
.dashboard-clinical-compact article {
  border: 1px solid #e6edf0;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.55rem 0.65rem;
}
.dashboard-donut-legend > div,
.dashboard-diagnosis-ranking > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}
.dashboard-donut-legend i {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
}
.dashboard-donut-legend span,
.dashboard-diagnosis-ranking span,
.dashboard-system-list span,
.dashboard-clinical-compact span {
  min-width: 0;
  color: var(--app-muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-donut-legend strong,
.dashboard-diagnosis-ranking strong,
.dashboard-system-list strong {
  color: var(--app-text);
  font-family: "IBM Plex Mono", monospace;
}
.dashboard-system-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.7rem;
  align-items: center;
}
.dashboard-system-list i {
  grid-column: 1 / -1;
  display: block;
  height: 0.42rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #65c7d6, #0f6b78);
}
.dashboard-clinical-compact article {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
}
.dashboard-clinical-compact strong {
  display: block;
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-clinical-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}
.dashboard-clinical-tags span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.55rem;
  border-radius: 999px;
  background: #eef8fb;
  color: #125364;
  padding: 0.15rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}
.dashboard-attention-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.dashboard-attention-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.82rem;
  border: 1px solid #e6edf0;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #ffffff, #fbfdfe);
}
.dashboard-attention-avatar {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 0.72rem;
  color: #654300;
  background: #fff0bd;
}
.dashboard-attention-time {
  text-align: right;
}
.dashboard-attention-time strong {
  color: #ba173f;
  font-family: "IBM Plex Mono", monospace;
}
.handoff-continuity-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid #8ac99e;
  border-left: 0.35rem solid #1f8b4c;
  border-radius: 0.75rem;
  background: #edf9f0;
  color: #14532d;
  padding: 0.85rem 1rem;
}
.handoff-continuity-alert-soft {
  border-color: #9dcbd6;
  border-left-color: var(--app-accent);
  background: #eef8fb;
  color: var(--app-text);
}
.handoff-continuity-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--app-border);
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 1rem;
}
.handoff-continuity-card-alert {
  border-color: #8ac99e;
  background: #f3fbf5;
}
.handoff-continuity-card h3 {
  margin: 0;
  font-size: 1rem;
}
.handoff-continuity-label {
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}
.dashboard-handoff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 0.75rem;
  align-items: stretch;
}
.dashboard-handoff-grid > div,
.dashboard-handoff-grid > a {
  display: grid;
  align-content: center;
  gap: 0.25rem;
  min-height: 4.6rem;
  border: 1px solid #e6edf0;
  border-radius: 0.75rem;
  background: #fbfdfe;
  padding: 0.8rem;
  text-decoration: none;
}
.dashboard-handoff-grid span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.dashboard-handoff-grid strong {
  color: var(--app-text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.7rem;
  line-height: 1;
}
.dashboard-handoff-grid > a {
  justify-items: center;
  color: var(--app-accent);
  font-weight: 700;
}
.admin-action-card {
  color: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.admin-action-card:hover,
.admin-action-card:focus {
  border-color: rgba(15, 107, 120, 0.22) !important;
  box-shadow: 0 18px 42px rgba(16, 44, 60, 0.12) !important;
  transform: translateY(-2px);
}
.admin-action-icon {
  display: inline-grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border-radius: 0.35rem;
  color: var(--app-accent-dark);
  background: rgba(15, 107, 120, 0.1);
  font-size: 1.25rem;
}
.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--app-border);
  border-radius: 0.45rem;
  background: #ffffff;
  color: inherit;
  padding: 0.75rem 0.85rem;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease;
}
.admin-user-row:hover,
.admin-user-row:focus,
.admin-user-row.active {
  border-color: rgba(15, 107, 120, 0.28);
  background: #eef8fb;
}
.admin-user-row strong,
.admin-user-row span {
  display: block;
}
.admin-user-row span {
  color: var(--app-muted);
  font-size: 0.82rem;
}
.admin-sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
}
.admin-sector-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  max-height: 16rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.admin-sector-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  min-height: 4rem;
  border: 1px solid var(--app-border);
  border-radius: 0.45rem;
  background: #ffffff;
  padding: 0.85rem;
}
.admin-sector-option input {
  margin-top: 0.2rem;
}
.admin-sector-option strong {
  display: block;
  color: var(--app-text);
  line-height: 1.25;
}
.admin-system-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  background: #ffffff;
}
.admin-system-header .accordion-button {
  min-width: 0;
  border-left: 0;
  padding-left: 0.65rem;
}
.admin-system-header .accordion-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-system-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.75rem;
  border-left: 1px solid #d7e5eb;
  background: #ffffff;
}
.admin-system-order {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  align-self: center;
  background: #ffffff;
  padding: 0 0.45rem 0 0.65rem;
}
.admin-system-order::after {
  content: "";
  width: 1px;
  height: 1.75rem;
  margin: 0 0.12rem;
  background: #d7e5eb;
  order: 2;
}
.admin-system-order-number {
  display: inline-grid;
  width: 2rem;
  height: 1.85rem;
  place-items: center;
  border: 1px solid #b8dce8;
  border-radius: 0.4rem;
  background: #eaf8fc;
  color: #0f6b78;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  font-weight: 700;
  order: 1;
}
.admin-system-order-button {
  display: inline-grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  border: 1px solid var(--app-border);
  border-radius: 0.4rem;
  background: #ffffff;
  color: var(--app-accent-dark);
  font-size: 1.25rem;
  line-height: 1;
  order: 3;
}
.admin-system-order-button:hover,
.admin-system-order-button:focus {
  border-color: rgba(15, 107, 120, 0.32);
  background: #eef8fb;
}
.admin-system-order-button:disabled {
  border-color: #e8eef1;
  color: #b5c1c9;
  background: #f8fafb;
  cursor: not-allowed;
}
.admin-hypothesis-list {
  min-width: 0;
}
.admin-hypothesis-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  align-items: center;
  border: 1px solid var(--app-border);
  border-radius: 0.45rem;
  background: #ffffff;
  padding: 0.45rem 0.65rem 0.45rem 0;
}
.admin-hypothesis-order {
  padding-left: 0.55rem;
  padding-right: 0.25rem;
}
.admin-hypothesis-name {
  min-width: 0;
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-hypothesis-status {
  justify-self: end;
}
.admin-status-badge {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.38rem 0.62rem;
  font-weight: 800;
}
.admin-status-badge-active {
  border-color: #84c79a;
  background: #dff7e8;
  color: #17633a;
}
.admin-status-badge-muted {
  border-color: #d6dee3;
  background: #eef2f4;
  color: #647887;
}
.admin-hypothesis-actions {
  display: inline-flex;
  gap: 0.35rem;
  justify-self: end;
}
.admin-icon-action {
  display: inline-grid;
  width: 2.05rem;
  height: 2.05rem;
  place-items: center;
  padding: 0;
  border-radius: 0.45rem;
}
.dashboard-shell .dashboard-hero,
.dashboard-shell .dashboard-filterbar,
.dashboard-shell .dashboard-subnav,
.dashboard-shell .dashboard-kpi,
.dashboard-shell .dashboard-panel,
.dashboard-shell .dashboard-overview-grid > div,
.dashboard-shell .dashboard-mini-list > div,
.dashboard-shell .dashboard-donut-card,
.dashboard-shell .dashboard-ranking-card,
.dashboard-shell .dashboard-sector-row,
.dashboard-shell .dashboard-attention-item,
.dashboard-shell .dashboard-donut-legend > div,
.dashboard-shell .dashboard-diagnosis-ranking > div,
.dashboard-shell .dashboard-system-list > div,
.dashboard-shell .dashboard-clinical-compact article {
  border-radius: 0.25rem;
}
.dashboard-shell .dashboard-hero,
.dashboard-shell .dashboard-panel,
.dashboard-shell .dashboard-kpi,
.dashboard-shell .dashboard-filterbar,
.dashboard-shell .dashboard-subnav {
  box-shadow: 0 10px 26px rgba(16, 44, 60, 0.06);
}
.dashboard-shell .dashboard-hero {
  background: #ffffff;
  border-left: 0.35rem solid var(--app-accent);
}
.dashboard-shell .dashboard-subnav button,
.dashboard-shell .dashboard-filterbar select,
.dashboard-shell .dashboard-filterbar button,
.dashboard-shell .dashboard-filterbar a,
.dashboard-shell .dashboard-panel-pill,
.dashboard-shell .dashboard-kpi-icon,
.dashboard-shell .dashboard-attention-avatar,
.dashboard-shell .dashboard-clinical-tags span {
  border-radius: 0.18rem;
}
.dashboard-shell .dashboard-subnav button.active {
  background: var(--app-accent);
}
.dashboard-chart-frame {
  position: relative;
  width: 100%;
  min-height: 18rem;
}
.dashboard-chart-frame-large {
  height: min(30rem, 56vh);
}
.dashboard-chart-frame-medium {
  height: 19rem;
}
.dashboard-chart-frame-donut {
  display: grid;
  height: 18rem;
  place-items: center;
}
.dashboard-chart-frame canvas {
  width: 100% !important;
  height: 100% !important;
}
.dashboard-chart-total {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.dashboard-chart-total strong {
  color: var(--app-text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 2rem;
  line-height: 1;
}
.dashboard-chart-total span {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.dashboard-donut-card {
  grid-template-columns: minmax(13rem, 0.95fr) minmax(0, 1fr);
}
.heatmap-year {
  color: var(--app-accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.55rem;
  font-weight: 700;
}
.heatmap-panel {
  overflow-x: auto;
}
.heatmap-grid {
  display: grid;
  grid-template-columns: 2.15rem repeat(31, 1.08rem);
  gap: 0.18rem;
  width: max-content;
}
.heatmap-corner,
.heatmap-day-header,
.heatmap-month-label {
  color: var(--app-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  line-height: 1.08rem;
  text-align: center;
}
.heatmap-day-header {
  font-weight: 700;
}
.heatmap-month-label {
  text-align: right;
  padding-right: 0.25rem;
  font-weight: 700;
}
.heatmap-cell {
  display: block;
  width: 1.08rem;
  height: 1.08rem;
  border: 1px solid rgba(216, 224, 229, 0.78);
  border-radius: 0.24rem;
  background: #ffffff;
}
.heatmap-cell:not(.heatmap-empty):not(.heatmap-future) {
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.heatmap-cell:not(.heatmap-empty):not(.heatmap-future):hover {
  border-color: rgba(15, 107, 120, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 107, 120, 0.12);
  transform: scale(1.18);
}
.heatmap-level-0 { background: #ffffff; }
.heatmap-level-1 { background: #fff4b8; }
.heatmap-level-2 { background: #ffd166; }
.heatmap-level-3 { background: #ff9f1c; }
.heatmap-level-4 { background: #ff5a36; }
.heatmap-level-5 {
  background: #ff174d;
  box-shadow: 0 0 10px rgba(255, 23, 77, 0.38);
}
.heatmap-today {
  outline: 2px solid #ab4654;
  outline-offset: 1px;
}
.heatmap-future {
  background: #f6f8f9;
  opacity: 0.46;
}
.heatmap-empty {
  border-color: transparent;
  background: transparent;
}
.heatmap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  min-width: 21rem;
}
.heatmap-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--app-muted);
  font-size: 0.74rem;
}
.heatmap-legend .heatmap-cell {
  width: 0.92rem;
  height: 0.92rem;
  border-radius: 0.2rem;
}
@media (max-width: 991.98px) {
  .dashboard-filterbar {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-kpi-grid,
  .dashboard-layout,
  .dashboard-attention-grid,
  .dashboard-overview-grid,
  .dashboard-sector-list,
  .dashboard-analytics-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-donut-card {
    grid-template-columns: 1fr;
  }
  .dashboard-panel-wide,
  .dashboard-layout > .dashboard-panel {
    grid-column: 1 / -1;
  }
}
@media (max-width: 767.98px) {
  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-subnav {
    top: 4.75rem;
  }
  .dashboard-filterbar {
    grid-template-columns: 1fr;
  }
  .dashboard-handoff-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-kpi-grid,
  .dashboard-layout,
  .dashboard-attention-grid,
  .dashboard-overview-grid,
  .dashboard-sector-list,
  .dashboard-analytics-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-bars {
    grid-template-columns: repeat(14, 2.35rem);
    overflow-x: auto;
    padding-bottom: 0.35rem;
  }
  .dashboard-sector-row {
    grid-template-columns: minmax(0, 1fr) 4rem auto;
  }
  .heatmap-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
.protocol-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
  align-items: start;
}
.protocol-folder-shell {
  min-width: 0;
}
.protocol-folder-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  min-height: 5.6rem;
  border: 1px solid rgba(15, 107, 120, 0.14);
  border-radius: 0.9rem;
  background: #ffffff;
  color: var(--app-text);
  padding: 1rem;
  text-align: left;
  box-shadow: 0 16px 34px rgba(16, 44, 60, 0.07);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.protocol-folder-card:hover,
.protocol-folder-card:focus {
  border-color: rgba(15, 107, 120, 0.35);
  box-shadow: 0 18px 38px rgba(16, 44, 60, 0.11);
  transform: translateY(-1px);
}
.protocol-folder-icon {
  display: inline-grid;
  width: 3rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 0.65rem;
  color: #d89a1d;
  background: #fff4cf;
  font-size: 1.65rem;
}
.protocol-folder-main,
.protocol-file-main {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}
.protocol-folder-name,
.protocol-file-title {
  display: block;
  overflow: hidden;
  color: var(--app-text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.protocol-folder-count,
.protocol-file-meta,
.protocol-empty-folder {
  color: var(--app-muted);
  font-size: 0.82rem;
}
.protocol-folder-toggle {
  color: var(--app-muted);
  transition: transform 150ms ease;
}
.protocol-folder-card:not(.collapsed) .protocol-folder-toggle {
  transform: rotate(180deg);
}
.protocol-folder-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.protocol-action-button {
  border-radius: 0.55rem;
  font-weight: 700;
}
.protocol-folder-panel {
  margin-top: 0.6rem;
  border: 1px solid var(--app-border);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.65rem;
}
.protocol-file-list {
  display: grid;
  gap: 0.5rem;
}
.protocol-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  background: #fbfdfe;
  color: inherit;
  padding: 0.45rem;
  transition: background 140ms ease, border-color 140ms ease;
}
.protocol-file-row:hover,
.protocol-file-row:focus {
  border-color: rgba(15, 107, 120, 0.2);
  background: #eef8fb;
  color: inherit;
}
.protocol-file-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  min-width: 0;
  color: inherit;
  padding: 0.3rem;
  text-decoration: none;
}
.protocol-file-icon {
  display: inline-grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border-radius: 0.55rem;
  color: var(--app-accent);
  background: rgba(15, 107, 120, 0.09);
}
.protocol-file-open {
  color: var(--app-muted);
}
.protocol-file-delete {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  padding: 0;
  border-radius: 0.5rem;
}
.protocol-empty-folder {
  padding: 0.75rem;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
.offline-status {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1085;
  width: min(22rem, calc(100vw - 2rem));
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.96);
  padding: 1rem;
}
.offline-status.is-offline {
  border-color: #f1c27a;
  background: #fff8ea;
}
.offline-status.is-syncing {
  border-color: #8fc6d4;
  background: #eef8fb;
}
.offline-status.is-error {
  border-color: #e6a3a8;
  background: #fff4f4;
}
@media (max-width: 1199.98px) { .patient-sidebar { position: static; } }
@media (max-width: 575.98px) {
  .profile-grid { grid-template-columns: 1fr; }
  .uti-card > .card-body { min-height: 0; }
  .uti-card-summary { padding-right: 0; }
  .uti-card-actions { position: static; margin: 1rem 0; }
}
