/**
 * MOB-UX-SHELL-01 — app shell staff (sidebar + main).
 * BS5 no cubre layout fijo 100vh + rail colapsable + overlay móvil.
 * Ink clínico SM (#1a1d24) — no paleta WellHu holding.
 */
:root {
	--staff-rail: 240px;
	--staff-rail-collapsed: 64px;
	--staff-ink: #1a1d24;
	--staff-ink-2: #2c3140;
	--staff-main-bg: #f4f5f7;
	--staff-ease: cubic-bezier(0.23, 1, 0.32, 1);
}

body.staff-shell {
	overflow: hidden;
	height: 100%;
}

.staff-app {
	display: flex;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
	background: var(--staff-main-bg);
}

.staff-app.is-collapsed {
	overflow: visible;
}

.staff-sidebar {
	width: var(--staff-rail);
	flex-shrink: 0;
	background: var(--staff-ink);
	color: #fff;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
	z-index: 1040;
	transition: width 0.22s var(--staff-ease);
}

.staff-app.is-collapsed .staff-sidebar {
	width: var(--staff-rail-collapsed);
}

.staff-sidebar-brand {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	min-height: 52px;
	flex-shrink: 0;
}

.staff-sidebar .navbar-brand {
	display: flex;
	align-items: center;
	min-width: 0;
	padding: 0;
	margin: 0;
}

.staff-sidebar .navbar-brand .navbar-brand-item {
	height: 36px;
	max-width: 148px;
	width: auto;
	object-fit: contain;
	background: #fff;
	border-radius: 8px;
	padding: 4px;
}

html[data-owame-host] .staff-sidebar .navbar-brand .navbar-brand-item {
	background: transparent;
	padding: 0;
	max-width: 176px;
	border-radius: 0;
}

.staff-app.is-collapsed .staff-sidebar .navbar-brand .navbar-brand-item {
	max-width: 40px;
	height: 36px;
	padding: 2px;
}

.staff-sidebar-collapse {
	margin-left: auto;
	color: rgba(255, 255, 255, 0.78) !important;
	padding: 4px 6px;
	line-height: 1;
	text-decoration: none;
}

.staff-sidebar-collapse:hover,
.staff-sidebar-collapse:focus {
	color: #fff !important;
}

.staff-sidebar-scroll {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.staff-sidebar-scroll::-webkit-scrollbar {
	width: 0;
	height: 0;
}

.staff-topbar > .d-flex {
	min-width: 0;
}

.staff-sidebar-nav,
.staff-sidebar-footer {
	width: 100%;
	flex: 0 0 auto;
	padding: 4px 0;
}

.staff-sidebar-footer {
	margin-top: 4px;
	padding-top: 4px;
	padding-bottom: 8px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.staff-nav-heading {
	list-style: none;
	font-size: 0.625rem;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.42);
	padding: 10px 12px 2px;
	font-weight: 600;
	line-height: 1.2;
}

.staff-app.is-collapsed .staff-nav-heading {
	display: none;
}

.staff-sidebar .nav-item {
	width: 100%;
}

.staff-sidebar .navbar-nav .nav-link,
.staff-sidebar .nav-link,
.staff-sidebar-link {
	display: flex;
	align-items: center;
	gap: 8px;
	color: rgba(255, 255, 255, 0.82);
	padding: 5px 12px;
	min-height: 32px;
	font-size: 0.8125rem;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	border-radius: 6px;
	margin: 1px 6px;
}

.staff-sidebar .nav-link:hover,
.staff-sidebar .nav-link:focus,
.staff-sidebar-link:hover,
.staff-sidebar-link:focus {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}

.staff-sidebar .nav-link.active,
.staff-sidebar .nav-link[aria-current='page'] {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-weight: 600;
}

.staff-sidebar .nav-link.text-danger {
	color: #f1a0a0;
}

.staff-sidebar .nav-link.text-danger:hover {
	color: #ffd0d0;
}

.staff-sidebar .nav-link i {
	flex-shrink: 0;
	width: 1.1rem;
	text-align: center;
	font-size: 1rem;
}

.staff-app.is-collapsed .staff-nav-label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.staff-app.is-collapsed .staff-sidebar {
	overflow: visible;
}

.staff-app.is-collapsed .staff-sidebar-scroll {
	overflow: visible;
}

.staff-app.is-collapsed .staff-sidebar .nav-link,
.staff-app.is-collapsed .staff-sidebar-brand {
	justify-content: center;
	padding-left: 8px;
	padding-right: 8px;
	margin-left: 4px;
	margin-right: 4px;
}

.staff-app.is-collapsed .staff-sidebar .nav-link {
	position: relative;
}

.staff-app.is-collapsed .staff-sidebar .nav-link:hover .staff-nav-label,
.staff-app.is-collapsed .staff-sidebar .nav-link:focus-visible .staff-nav-label {
	clip: auto;
	clip-path: none;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	position: absolute;
	left: calc(100% + 10px);
	top: 50%;
	transform: translateY(-50%);
	background: var(--staff-ink);
	color: #fff;
	padding: 6px 10px;
	border-radius: 6px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
	z-index: 1080;
	font-size: 0.8125rem;
	font-weight: 500;
	pointer-events: none;
	white-space: nowrap;
}

.staff-app.is-collapsed .staff-sidebar-brand {
	flex-direction: column;
}

.staff-app.is-collapsed .staff-sidebar-collapse {
	margin-left: 0;
}

.staff-app.is-collapsed .staff-sidebar [data-fin-dropdown] .dropdown-toggle {
	font-size: 0;
	padding-left: 8px;
	padding-right: 8px;
	justify-content: center;
}

.staff-app.is-collapsed .staff-sidebar [data-fin-dropdown] .dropdown-toggle::before {
	font-family: 'bootstrap-icons';
	content: '\f23d';
	font-size: 1.1rem;
	color: rgba(255, 255, 255, 0.82);
}

.staff-app.is-collapsed .staff-sidebar .dropdown-toggle::after {
	display: none;
}

.staff-sidebar [data-fin-dropdown] .dropdown-toggle::before {
	font-family: 'bootstrap-icons';
	content: '\f23d';
	margin-right: 10px;
	font-size: 1.1rem;
}

.staff-sidebar [data-fin-dropdown] .dropdown-menu {
	background: var(--staff-ink-2);
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.staff-sidebar [data-fin-dropdown] .dropdown-item {
	color: rgba(255, 255, 255, 0.88);
}

.staff-sidebar [data-fin-dropdown] .dropdown-item:hover,
.staff-sidebar [data-fin-dropdown] .dropdown-item:focus,
.staff-sidebar [data-fin-dropdown] .dropdown-item.active {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.staff-app.is-collapsed .staff-sidebar [data-fin-dropdown] .dropdown-menu {
	position: absolute;
	left: calc(100% + 4px);
	bottom: 0;
	top: auto;
}

.staff-sidebar-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 1035;
}

.staff-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.staff-topbar {
	flex-shrink: 0;
	background: #fff;
	border-bottom: 1px solid #e2e4e8;
	padding: 12px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	z-index: 1020;
}

#btnAyudaQa.btn {
	width: 1.7rem;
	height: 1.7rem;
	min-width: 1.7rem;
	min-height: 1.7rem;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	border-radius: 0.35rem;
}

.ayuda-qa-slot {
	display: inline-block;
	width: 1.7rem;
	height: 1.7rem;
	min-width: 1.7rem;
	flex: 0 0 1.7rem;
}

#btnAyudaQa.ayuda-qa-fab {
	position: fixed;
	margin: 0;
	z-index: 1065;
	box-sizing: border-box;
}

body.ayuda-qa-open #btnAyudaQa.ayuda-qa-fab {
	z-index: 1060;
}

#offcanvasAyudaQa {
	z-index: 1080;
	width: min(24rem, 100vw);
}

body.ayuda-qa-open > .offcanvas-backdrop {
	z-index: 1075;
}

/* QA-2026-09-14-04 — alta rápida paciente/servicio: panel lateral sobre Nueva cita, sin segundo modal */
#modalPacienteRapido.offcanvas,
#modalServicioRapido.offcanvas {
	z-index: 1080;
	width: min(26rem, 100vw);
}

body.agenda-rapido-open > .offcanvas-backdrop {
	z-index: 1075;
}

/* MOB-UX-EVAL-PROTOCOLO-01 — cajón CIE-10 sobre modal evaluación */
#offcanvasCie10.offcanvas {
	z-index: 1080;
	width: min(26rem, 100vw);
}

body.cie10-browse-open > .offcanvas-backdrop {
	z-index: 1075;
}

/* MOB-UX-EVAL-PROTOCOLO-01 — 2º modal share sobre modalEval */
#modalShareDocsEval {
	z-index: 1090;
}
#modalShareDocsEval + .modal-backdrop,
body:has(#modalShareDocsEval.show) .modal-backdrop:last-of-type {
	z-index: 1085;
}

#btnAyudaQa.btn i,
#btnAyudaQa .bi {
	margin: 0;
	font-size: 1.2rem;
	line-height: 1;
	display: block;
}

#staffClock {
	font-size: 0.9rem;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
	color: #5c6370;
}

@media (min-width: 992px) {
	#pisoAccordion {
		display: flex;
		flex-wrap: wrap;
		align-items: stretch;
		gap: 1rem;
	}
	#pisoAccordion > .accordion-item {
		flex: 1 1 20rem;
		margin-bottom: 0 !important;
	}
	#pisoAccordion .accordion-collapse {
		display: block !important;
		height: auto !important;
		visibility: visible !important;
	}
	#pisoAccordion .accordion-button {
		pointer-events: none;
		box-shadow: none;
	}
	#pisoAccordion .accordion-button::after {
		display: none;
	}
}

#ayudaQaCapRow {
	margin: 0.35rem 0 0;
	min-height: 0;
	padding-top: 0.05rem;
}

#ayudaQaCapRow .form-check-input {
	width: 1.55em;
	height: 0.85em;
	margin-top: 0.18rem;
	cursor: pointer;
}

#ayudaQaCapRow .form-check-label {
	font-size: 0.68rem;
	line-height: 1.25;
	color: #6c757d;
	cursor: pointer;
}

.staff-topbar-toggle {
	display: none;
}

.staff-main-scroll {
	flex: 1 1 auto;
	overflow-y: auto;
	min-height: 0;
}

.staff-quick-card {
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 0.5rem;
	background: #fff;
	padding: 12px 14px;
	height: 100%;
	min-height: 44px;
	cursor: pointer;
	transition: box-shadow 0.2s var(--staff-ease), transform 0.2s var(--staff-ease);
}

.staff-quick-card:hover,
.staff-quick-card:focus {
	box-shadow: 0 0.5rem 1.25rem rgba(26, 29, 36, 0.1);
	transform: translateY(-1px);
	outline: none;
}

.staff-next-placeholder {
	border: 1px dashed #cfd3dc;
	background: #fff;
}

@media (max-width: 991.98px) {
	.staff-sidebar {
		position: fixed;
		inset: 0 auto 0 0;
		width: var(--staff-rail) !important;
		transform: translateX(-100%);
		transition: transform 0.22s var(--staff-ease);
	}

	.staff-app.is-open .staff-sidebar {
		transform: none;
	}

	.staff-app.is-open .staff-sidebar-backdrop {
		display: block;
	}

	.staff-app.is-collapsed .staff-sidebar {
		width: var(--staff-rail) !important;
	}

	.staff-app.is-collapsed .staff-nav-label {
		position: static;
		width: auto;
		height: auto;
		margin: 0;
		clip: auto;
		overflow: visible;
		transform: none;
		background: transparent;
		box-shadow: none;
		padding: 0;
	}

	.staff-sidebar .navbar-nav .nav-link,
	.staff-sidebar .nav-link {
		min-height: 40px;
		padding: 8px 12px;
	}

	.staff-topbar-toggle {
		display: inline-flex;
	}
}

@media (prefers-reduced-motion: reduce) {
	.staff-sidebar,
	.staff-quick-card {
		transition: none;
	}
}

/* Combobox staff (paciente + catálogo cobro): flecha anclada al recuadro del input.
   El <select> nativo cubre la pantalla; un .btn hermano no calza en vertical. */
.staff-combo-field {
	position: relative;
}

.staff-combo-field .form-control {
	padding-right: 2.5rem;
	margin-bottom: 0;
}

.staff-combo-toggle {
	position: absolute;
	top: 2px;
	right: 2px;
	bottom: 2px;
	width: 2.25rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-left: 1px solid #dfe2e5;
	border-radius: 0 1px 1px 0;
	background: #fff;
	color: #6c757d;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	box-sizing: border-box;
	cursor: pointer;
}

.staff-combo-toggle:hover,
.staff-combo-toggle:focus {
	background: #f8f9fa;
	color: #343a40;
	outline: 0;
}

.staff-combo-field .form-control:focus + .staff-combo-toggle {
	border-left-color: #4cbd89;
}

.staff-combo-toggle i {
	margin: 0;
	font-size: 0.7rem;
	line-height: 1;
}

.staff-combo-results {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 1050;
	max-height: 16rem;
	overflow-y: auto;
	background: #fff;
	margin-top: 0.25rem;
	box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
}

#citasPendientesList {
	max-height: 16rem;
	overflow-y: auto;
	background: #fff;
}

/* Fila Agregar al carrito: misma altura de etiqueta y de control.
   El tema .btn { margin-bottom: 6px } y labels de distinta altura
   dejan el combo y + Agregar más abajo que cantidad/precio. */
#catSearchBlock .cat-add-row {
	align-items: end;
}

#catSearchBlock .cat-add-label {
	display: block;
	min-height: 1.25rem;
	line-height: 1.25rem;
	margin-bottom: 0.25rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#catSearchBlock .cat-add-row .form-control,
#catSearchBlock .staff-combo-field,
#catSearchBlock .staff-combo-field .form-control {
	height: 2.5rem;
	min-height: 2.5rem;
	margin-bottom: 0;
	box-sizing: border-box;
}

#addItemBtn.cat-add-submit {
	height: 2.5rem;
	min-height: 2.5rem;
	margin-bottom: 0;
	padding: 0 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	box-sizing: border-box;
}

/* QA-2026-09-14-03 — Nueva cita: + Nuevo / + Servicio al ras del select.
   El tema .btn { margin-bottom: 6px } estira el botón por debajo del campo. */
#modalCita .staff-field-addon {
	flex-wrap: nowrap;
	align-items: stretch;
}

#modalCita .staff-field-addon > .form-select {
	margin-bottom: 0;
}

#modalCita .staff-field-addon > .btn {
	margin-bottom: 0;
	align-self: stretch;
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	box-sizing: border-box;
	padding-top: 0;
	padding-bottom: 0;
	line-height: 1.2;
}

/* QA-2026-09-14-05 — acciones en Agenda de hoy (día clínico) */
#diaAgendaList .btn {
	margin-bottom: 0;
}

#ev_cie10_results {
	max-height: 14rem;
	overflow-y: auto;
	z-index: 5;
	position: relative;
}

#ev_cie10_results .list-group-item.active,
#cieBrowseList .list-group-item.active {
	background-color: #e9ecef;
	border-color: #ced4da;
	color: #1a1d24;
	z-index: 1;
}

#ev_cie10_results .list-group-item:focus-visible,
#cieBrowseList .list-group-item:focus-visible {
	outline: 2px solid #0d6efd;
	outline-offset: -2px;
}

#chipsDxActivos .badge {
	max-width: 16rem;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* QA-2026-09-14-06 — popover eval encima del botón (no al pie de Acciones) */
#cardAccionesClinicas,
#cardAccionesClinicas .card-body,
#wrapNuevaEval {
	overflow: visible;
}

.eval-suggest-pop {
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(100% + 0.4rem);
	z-index: 1080;
	background: #fff;
	border: 1px solid #c5d4f0;
	border-radius: 0.5rem;
	box-shadow: 0 0.45rem 1.2rem rgba(26, 29, 36, 0.18);
	padding: 0.75rem 0.8rem 0.7rem;
	text-align: left;
}

.eval-suggest-pop::after {
	content: '';
	position: absolute;
	left: 1.1rem;
	top: 100%;
	border: 6px solid transparent;
	border-top-color: #fff;
	filter: drop-shadow(0 1px 0 #c5d4f0);
}

/* QA-2026-09-14-08 — Episodio + Nuevo episodio en la misma fila.
   El tema .btn { margin-bottom: 6px } descalza el input-group. */
#wrapSelectorEpisodio .btn,
#wrapSelectorEpisodio .form-select,
#wrapSelectorEpisodio .input-group-text {
	margin-bottom: 0;
}

/* MOB-UX-RECETA-PLANTILLA-01 — matriz tipográfica de receta (composito clínico) */
.rp-matrix-wrap {
	border-top: 1px solid #d8dbe0;
	overflow-x: auto;
	max-width: 100%;
	-webkit-overflow-scrolling: touch;
}

.rp-matrix-wrap::-webkit-scrollbar {
	height: 8px;
}

.rp-matrix-wrap::-webkit-scrollbar-thumb {
	background: #c5c9d0;
	border-radius: 4px;
}

.rp-matrix {
	font-size: 0.8125rem;
	margin-bottom: 0;
}

.rp-matrix thead th {
	white-space: nowrap;
	font-weight: 600;
	color: #2c3140;
	background: #f4f5f7;
	border-bottom-color: #d8dbe0;
	font-size: 0.72rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.rp-matrix tbody th,
.rp-matrix tbody td {
	vertical-align: bottom;
}

.rp-matrix .rp-section-row td {
	vertical-align: middle;
}

.rp-matrix .rp-matrix-label {
	min-width: 13.5rem;
	max-width: 16rem;
	font-weight: 600;
	color: var(--staff-ink);
	vertical-align: bottom;
}

.rp-img-slot {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
}

.rp-img-thumb {
	display: block;
	max-width: 9.5rem;
	max-height: 3.25rem;
	object-fit: contain;
	background: #fff;
	border: 1px solid #d8dbe0;
	border-radius: 0.25rem;
}

.rp-matrix .form-select-sm {
	min-width: 5.5rem;
	font-size: 0.78rem;
}

.rp-orden-td {
	width: 4.25rem;
	text-align: center;
}

.rp-matrix .form-control-color {
	width: 2.25rem;
	height: 2rem;
	padding: 0.15rem;
	cursor: pointer;
}

.rp-section-row td {
	background: #eef0f3;
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #5c6570;
	font-weight: 600;
	padding-top: 0.55rem;
	padding-bottom: 0.45rem;
}

.rp-sheet {
	background: #fff;
	width: min(100%, 210mm);
	min-height: 22rem;
	padding: 1.35rem 1.5rem 1.2rem;
	border: 1px solid #d0d4da;
	box-shadow: 0 0.55rem 1.6rem rgba(26, 29, 36, 0.12);
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.rp-sheet-label {
	font-size: 0.65rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #7a8290;
}

.rp-clinic {
	font-weight: 700;
	color: var(--staff-ink);
	margin-bottom: 0.35rem;
}

.rp-zone {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-height: 4.5rem;
}

.rp-zone-footer {
	margin-top: 0.5rem;
}

.rp-band {
	display: flex;
	flex-direction: column;
	gap: 0.12rem;
	min-height: 1.15rem;
}

.rp-band-centro {
	flex: 1;
	justify-content: center;
}

.rp-band-abajo {
	justify-content: flex-end;
}

.rp-sheet-rule {
	height: 1px;
	background: #c5c9d0;
	margin: 0.35rem 0;
}

.rp-sheet-note {
	font-size: 0.75rem;
	color: #6b7280;
	margin: 0;
}

.rp-orden-ctl {
	display: flex;
	align-items: center;
	gap: 0.2rem;
}

.rp-orden-input {
	width: 3.5rem;
	text-align: center;
	padding-left: 0.25rem;
	padding-right: 0.25rem;
	margin: 0 auto;
}

.rp-orden-ctl .btn {
	padding: 0.15rem 0.35rem;
	line-height: 1;
}

.rp-logo-size {
	display: flex;
	align-items: center;
	gap: 0.2rem;
	flex-wrap: wrap;
	position: relative;
}

.rp-lupa {
	border: 0;
	background: transparent;
	padding: 0 0.1rem;
	line-height: 1;
	color: #2c3140;
}

.rp-lupa:hover,
.rp-lupa:focus-visible {
	color: #0b5f6b;
}

.rp-lupa-tip {
	display: none;
	font-size: 0.72rem;
	color: #5c6570;
	white-space: nowrap;
}

.rp-logo-size:hover .rp-lupa-tip,
.rp-logo-size:focus-within .rp-lupa-tip {
	display: inline;
}

.rp-img-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.75rem;
}

.rp-cm {
	max-width: 6.5rem;
}

.rp-logo-mm-label {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: var(--staff-ink);
	min-width: 3.4rem;
	text-align: center;
}

.rp-na {
	color: #8b919a;
}

.rp-obliga {
	font-size: 0.62rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #7a8290;
	margin-top: 0.15rem;
}

.rp-row-off th,
.rp-row-off td {
	opacity: 0.55;
}

.rp-row-off input[type='checkbox'] {
	opacity: 1;
}

.rp-logo-ph {
	background: #f4f5f7;
	border: 1px dashed #c5c9d0;
	min-width: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.rp-logo-ph-label {
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8b919a;
}
