.cbm-entry-body[hidden] { display: none !important; }
.cbm-entry-toolbar { display: flex; justify-content: flex-start; margin-bottom: 12px; }
.cbm-entry-back { background: transparent; border: 0; border-radius: 10px; padding: 8px 4px; color: #c8102e; font: inherit; font-size: 14px; cursor: pointer; }
.cbm-entry-back:focus-visible { outline: 2px solid #c8102e; outline-offset: 3px; }

/* Shared visual contract: clinical (HC / Enfermería / Especialidades) + Cuidadores */
.cbm {
  --cbm-fg: #1d1d1f; --cbm-muted: #6e6e73; --cbm-faint: #a1a1a6; --cbm-tile: #f4f4f6; --cbm-tile-hover: #ececf0;
  --cbm-soft: #f2f2f5; --cbm-hair: rgba(60,60,67,.14); --cbm-red: #c8102e; --cbm-amber: #9a4f00; --cbm-focus: rgba(200,16,46,.4);
  color: var(--cbm-fg); display: flex; flex-direction: column; gap: 28px; width: 100%; min-width: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
.dark .cbm {
  --cbm-fg: #f5f5f7; --cbm-muted: #a1a1a8; --cbm-faint: #6e6e73; --cbm-tile: #1f1f22; --cbm-tile-hover: #2a2a2e;
  --cbm-soft: #26262a; --cbm-hair: rgba(235,235,245,.14); --cbm-red: #ff5a6e; --cbm-amber: #f0a64a; --cbm-focus: rgba(255,90,110,.5);
}
.cbm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cbm-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.cbm-title { margin: 0; font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.02em; }
.cbm-sub { margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--cbm-muted); }
.cbm-toolbar { display: flex; gap: 10px; align-items: center; flex: 0 1 420px; min-width: 0; }
.cbm-search {
  flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 14px; border-radius: 10px; border: 0;
  background: var(--cbm-soft); color: var(--cbm-fg); font: inherit; font-size: 15px; outline: none;
}
.cbm-search::placeholder { color: var(--cbm-faint); }
.cbm .cbm-search::placeholder { color: var(--cbm-muted) !important; opacity: 1; }
.cbm .cbm-sub, .cbm .cbm-dx, .cbm .cbm-summary dt { color: var(--cbm-muted) !important; }
[data-testid="page-cuidadores"] [data-testid="text-shift"] { color: #6e6e73 !important; }
.dark [data-testid="page-cuidadores"] [data-testid="text-shift"] { color: #a1a1a8 !important; }
.cbm-search:focus-visible { box-shadow: 0 0 0 3px var(--cbm-focus); }
.cbm-search:disabled { opacity: .6; }
.cbm-btn {
  height: 38px; padding: 0 12px; border-radius: 10px; border: 0; background: transparent;
  color: var(--cbm-red); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.cbm-btn:hover:not(:disabled) { background: var(--cbm-soft); }
.cbm-btn:disabled { opacity: .5; cursor: default; }
.cbm-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--cbm-focus); }

.cbm-summary { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 8px 24px; width: fit-content; max-width: 100%; margin: -4px 0; padding: 0; }
.cbm-summary-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 0; text-align: center; white-space: nowrap; }
.cbm-summary dd { margin: 0; order: 0; font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.02em; }
.cbm-summary dt { order: 1; font-size: 12px; line-height: 18px; color: var(--cbm-muted); }
.cbm-progress { margin: -16px 0 0; font-size: 13px; line-height: 20px; color: var(--cbm-muted); }

.cbm-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; text-align: center; font-size: 15px; color: var(--cbm-muted); }
.cbm-state p { margin: 0; max-width: 42ch; }
.cbm-wing { display: flex; flex-direction: column; gap: 12px; }
.cbm-wing-title { margin: 0; font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.01em; display: flex; gap: 8px; align-items: baseline; }
.cbm-wing-title span { font-size: 13px; font-weight: 400; color: var(--cbm-muted); }
.cbm-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.cbm-cell { display: flex; min-width: 0; }

/* Only identifiable/selectable beds get a surface. */
.cbm-bed {
  display: flex; flex-direction: column; gap: 8px; width: 100%; min-width: 0; padding: 12px 14px; border: 0; border-radius: 14px;
  background: var(--cbm-tile); color: inherit; font: inherit; text-align: left;
}
.cbm-bed--empty, .cbm-bed--blocked, .cbm-bed--restricted {
  background: transparent; box-shadow: inset 0 0 0 1px var(--cbm-hair); color: var(--cbm-muted);
}
.cbm-bed--maintenance .cbm-status, .cbm-bed--blocked .cbm-status { color: var(--cbm-amber); }
button.cbm-bed { cursor: pointer; transition: background-color .15s ease, transform .15s ease; }
button.cbm-bed:hover { background: var(--cbm-tile-hover); }
button.cbm-bed:active { transform: scale(.985); }
button.cbm-bed:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--cbm-focus); }
.cbm-bed-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; line-height: 18px; }
.cbm-code { font-weight: 600; overflow-wrap: anywhere; }
.cbm-status { color: var(--cbm-muted); text-align: right; flex-shrink: 0; }
.cbm-bed-note { margin: 0; font-size: 14px; line-height: 20px; }
.cbm-warn { margin: 0; font-size: 13px; line-height: 18px; color: var(--cbm-amber); }
.cbm-mine { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--cbm-red); vertical-align: 1px; }
.cbm-resident {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px; margin: 0 -6px; border: 0; border-radius: 10px;
  background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; box-sizing: content-box;
  transition: background-color .15s ease, transform .15s ease;
}
.cbm-resident:hover { background: var(--cbm-tile-hover); }
.cbm-resident:active { transform: scale(.985); }
.cbm-resident:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--cbm-focus); }
.cbm-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cbm-avatar { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--cbm-soft); }
.cbm-avatar--initials { display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; color: var(--cbm-muted); }
.cbm-resident-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.cbm-name { font-size: 15px; font-weight: 600; line-height: 20px; overflow-wrap: anywhere; }
.cbm-dx {
  font-size: 13px; line-height: 17px; color: var(--cbm-muted); overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.cbm-dx--empty, .cbm-dx[data-empty="true"] { font-style: italic; }
.cbm-meta { margin-top: auto; font-size: 13px; line-height: 18px; color: var(--cbm-muted); overflow-wrap: anywhere; }
.cbm-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; font-size: 13px; color: var(--cbm-muted); }
.cbm-skel { height: 96px; border-radius: 14px; background: var(--cbm-soft); animation: cbm-pulse 1.4s ease-in-out infinite; }
@keyframes cbm-pulse { 50% { opacity: .5; } }
@media (max-width: 767px) {
  .cbm { gap: 24px; }
  .cbm-toolbar { flex-basis: 100%; }
  .cbm-grid { grid-template-columns: 1fr; }
  .cbm-summary { gap: 6px 16px; }
  .cbm-summary dd { font-size: 16px; line-height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .cbm-skel { animation: none; }
  .cbm-resident, button.cbm-bed { transition: none; }
  .cbm-resident:active, button.cbm-bed:active { transform: none; }
}
