/* ==========================================
   MENU PRINCIPAL - Rediseño moderno / minimalista
   Estructura: etiquetas visibles agrupadas por función
   Conserva la paleta original: #069 (claro) / #132042 (oscuro)
   ========================================== */

#MenuPrincipal .menu-bar {
	display: flex;
	align-items: center;
	height: 100%;
	padding: 0 18px;
	gap: 18px;
}

/* ---- Marca ---- */
#MenuPrincipal .menu-brand {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.3px;
	color: #fff;
	white-space: nowrap;
	cursor: pointer;
	padding: 6px 8px;
	margin: 0 -8px;
	border-radius: 8px;
	transition: background-color 0.15s ease;
}

#MenuPrincipal .menu-brand:hover {
	background-color: rgba(255, 255, 255, 0.12);
}

#MenuPrincipal .menu-brand img {
	height: 26px;
	width: auto;
	border-radius: 6px;
}

/* ---- Navegación (grupos con etiquetas) ---- */
#MenuPrincipal .menu-nav {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1 1 auto;
	min-width: 0;
}

#MenuPrincipal .menu-group {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 0 10px;
	border-right: 1px solid rgba(255, 255, 255, 0.18);
	flex: 0 0 auto;
}

#MenuPrincipal .menu-group:last-child {
	border-right: none;
}

#MenuPrincipal .menu-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	white-space: nowrap;
}

#MenuPrincipal .menu-user {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-right: 4px;
	margin-right: 2px;
	border-right: 1px solid rgba(255, 255, 255, 0.18);
}

#MenuPrincipal .menu-username {
	font-size: 13px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.9);
}

/* ---- Botón con etiqueta (navegación principal) ---- */
#MenuPrincipal .menu-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 42px;
	height: 42px;
	padding: 0;
	border-radius: 10px;
	color: #fff;
	background: transparent;
	border: none;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

#MenuPrincipal .menu-btn i {
	font-size: 20px;
	line-height: 1;
}

#MenuPrincipal .menu-btn:hover,
#MenuPrincipal .menu-btn:focus {
	background-color: rgba(255, 255, 255, 0.16);
	color: #fff;
}

#MenuPrincipal .menu-btn.dropdown-toggle::after {
	content: '';
	display: inline-block;
	margin-left: 2px;
	border: 4px solid transparent;
	border-top-color: rgba(255, 255, 255, 0.7);
	border-bottom: 0;
	vertical-align: middle;
}

/* ---- Botones solo-icono (usuario / tema / salir) ---- */
#MenuPrincipal .menu-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 10px;
	color: #fff;
	background: transparent;
	border: none;
	font-size: 20px;
	cursor: pointer;
	transition: background-color 0.15s ease;
	flex: 0 0 auto;
}

#MenuPrincipal .menu-icon-btn:hover,
#MenuPrincipal .menu-icon-btn:focus {
	background-color: rgba(255, 255, 255, 0.16);
	color: #fff;
}

/* ---- Panel desplegable de Administración (lista vertical) ---- */
#MenuPrincipal .menu-dd-panel {
	border: none;
	border-radius: 12px;
	padding: 6px;
	margin-top: 8px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
	background: #ffffff;
	min-width: 230px;
}

#MenuPrincipal .menu-dd-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 8px;
	color: #2c3e50;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

#MenuPrincipal .menu-dd-item i {
	font-size: 14px;
	width: 18px;
	text-align: center;
	color: #069;
	flex: 0 0 auto;
}

#MenuPrincipal .menu-dd-item span {
	font-size: 13px;
	font-weight: 500;
}

#MenuPrincipal .menu-dd-item:hover {
	background-color: #f0f4f8;
}

/* ---- Badge de notificaciones (SICMA News) ---- */
.sn-menu-badge { position: relative; }
.sn-menu-badge::after {
	content: '';
	position: absolute;
	top: 4px;
	right: 6px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ff4757;
	border: 2px solid #069;
}
[data-theme="dark"] .sn-menu-badge::after { border-color: #132042; }

.sn-menu-pulse i { animation: snMenuPulse 1.6s ease-in-out infinite; }
@keyframes snMenuPulse {
	0%, 100% { color: #fff; transform: scale(1); }
	50% { color: #ffd166; transform: scale(1.15); }
}

/* ==========================================
   MODO OSCURO
   ========================================== */
[data-theme="dark"] #MenuPrincipal .menu-group {
	border-right-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #MenuPrincipal .menu-user {
	border-right-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #MenuPrincipal .menu-username {
	color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] #MenuPrincipal .menu-btn:hover,
[data-theme="dark"] #MenuPrincipal .menu-btn:focus,
[data-theme="dark"] #MenuPrincipal .menu-icon-btn:hover,
[data-theme="dark"] #MenuPrincipal .menu-icon-btn:focus {
	background-color: rgba(255, 255, 255, 0.1);
	color: #66b2ff;
}

[data-theme="dark"] #MenuPrincipal .menu-dd-panel {
	background: #1a2540 !important;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] #MenuPrincipal .menu-dd-item {
	color: #e4e6eb;
}

[data-theme="dark"] #MenuPrincipal .menu-dd-item i {
	color: #66b2ff;
}

[data-theme="dark"] #MenuPrincipal .menu-dd-item:hover {
	background-color: rgba(255, 255, 255, 0.08);
}

/* ==========================================
   MODAL PERFIL DE USUARIO
   ========================================== */
.profile-modal-dialog {
	max-width: 360px;
	margin: 60px auto 0;
}

.profile-modal-content {
	border: none;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.profile-modal-close {
	all: unset;
	position: absolute;
	top: 12px;
	right: 14px;
	z-index: 2;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.15);
	transition: background-color 0.15s ease;
}

.profile-modal-close:hover {
	background: rgba(0, 0, 0, 0.3);
}

.profile-modal-banner {
	height: 92px;
	position: relative;
	background: linear-gradient(120deg, #1ba3e0 0%, #0077b3 35%, #005e94 60%, #06304f 100%);
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.profile-modal-banner-bg {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 0;
}

.profile-modal-banner-bg::before {
	content: '';
	position: absolute;
	inset: -20px;
	background-image: url('/V04/imagenes/logo-alora2.png');
	background-repeat: repeat;
	background-size: 40px 40px;
	transform: rotate(-12deg) scale(1.35);
	mix-blend-mode: multiply;
	opacity: 0.55;
}

.profile-modal-avatar {
	position: relative;
	z-index: 1;
	width: 84px;
	height: 84px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: #eef2f7;
	color: #045a86;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 4px solid var(--card-bg, #fff);
	transform: translateY(42px);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.profile-modal-avatar svg {
	width: 46px;
	height: 46px;
	fill: currentColor;
	flex: 0 0 auto;
	transform: translateY(4px);
}

.profile-modal-body {
	padding: 54px 24px 20px;
	text-align: center;
}

.profile-modal-name {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	color: var(--text-main, #212529);
}

.profile-modal-role {
	display: inline-block;
	margin: 0 0 4px;
	padding: 4px 12px;
	border-radius: 999px;
	background: #e4eef4;
	color: #045a86;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

[data-theme="dark"] .profile-modal-role {
	background: #17293a;
	color: #6fb7e0;
}

.profile-modal-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 12px;
	text-align: left;
}

.profile-modal-info-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 4px;
	border-top: 1px solid var(--border-color, #eef0f3);
}

.profile-modal-info-row:first-child {
	border-top: none;
}

.profile-modal-info-row i {
	width: 18px;
	flex: 0 0 auto;
	text-align: center;
	font-size: 14px;
	color: #069;
}

.profile-modal-info-row div {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.profile-modal-info-row span {
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--text-muted, #94a3b8);
}

.profile-modal-info-row strong {
	font-size: 13.5px;
	font-weight: 500;
	color: var(--text-main, #212529);
	overflow-wrap: anywhere;
}

[data-theme="dark"] .profile-modal-info-row i {
	color: #66b2ff;
}

.profile-modal-footer {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 4px 24px 24px;
}

.profile-modal-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	border-radius: 9px;
	border: 1px solid var(--border-color, #dee2e6);
	background: transparent;
	color: var(--text-main, #212529);
	font-size: 13.5px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.profile-modal-btn:hover {
	background: var(--hover-bg, #eef2f7);
}

.profile-modal-btn-primary {
	background: #069;
	border-color: #069;
	color: #fff;
}

.profile-modal-btn-primary:hover {
	background: #045680;
	border-color: #045680;
}

[data-theme="dark"] .profile-modal-avatar {
	background: #1a2540;
	color: #66b2ff;
}

[data-theme="dark"] .profile-modal-btn {
	color: #e4e6eb;
}

[data-theme="dark"] .profile-modal-btn-primary {
	background: #105964;
	border-color: #105964;
	color: #fff;
}

[data-theme="dark"] .profile-modal-btn-primary:hover {
	background: #0d4a53;
	border-color: #0d4a53;
}

/* ==========================================
   MENU COMPACTO AL HACER SCROLL
   bin/Menu.php agrega la clase .menu-compacto a <html> cuando la pagina se desplaza; el menu baja
   de 63px a 32px para dejar mas espacio al contenido. --menu-alto expone el alto vigente para los
   elementos fijos debajo del menu (p.ej. encabezados de tabla con position: sticky).
   ========================================== */
:root { --menu-alto: 63px; }
html.menu-compacto { --menu-alto: 32px; }

#MenuPrincipal { transition: height 0.2s ease; }
html.menu-compacto #MenuPrincipal { height: var(--menu-alto); }

#MenuPrincipal .menu-btn,
#MenuPrincipal .menu-icon-btn,
#MenuPrincipal .menu-brand img {
	transition: width 0.2s ease, height 0.2s ease, font-size 0.2s ease, background-color 0.15s ease;
}

html.menu-compacto #MenuPrincipal .menu-btn,
html.menu-compacto #MenuPrincipal .menu-icon-btn {
	width: 32px;
	height: 32px;
	font-size: 16px;
}

html.menu-compacto #MenuPrincipal .menu-btn i { font-size: 16px; }
html.menu-compacto #MenuPrincipal .menu-brand { padding: 2px 8px; font-size: 13px; }
html.menu-compacto #MenuPrincipal .menu-brand img { height: 20px; }

/* PRUEBA (2026-10-02): menu compacto semitransparente con desenfoque del contenido de atras.
   Para revertir basta con borrar este bloque. */
#MenuPrincipal { transition: height 0.2s ease, background-color 0.2s ease; }
html.menu-compacto #MenuPrincipal {
	background: rgba(0, 119, 179, 0.786);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}
html.menu-compacto[data-theme="dark"] #MenuPrincipal {
	background: rgba(26, 42, 84, 0.72) !important;
}
/* FIN PRUEBA */

/* ---- Responsive ---- */
@media (max-width: 900px) {
	#MenuPrincipal .menu-username { display: none; }
	#MenuPrincipal .menu-user { border-right: none; padding-right: 0; margin-right: 0; }
	#MenuPrincipal .menu-btn span { display: none; }
	#MenuPrincipal .menu-btn { width: 34px; padding: 0; justify-content: center; }
	#MenuPrincipal .menu-btn.dropdown-toggle::after { display: none; }
}

@media (max-width: 640px) {
	#MenuPrincipal .menu-brand span { display: none; }
	#MenuPrincipal .menu-bar { gap: 8px; padding: 0 10px; }
}
