:root {
	/* Las variables se cargan dinámicamente desde la base de datos en main.php */
}

/* define estilos base */
body {
	margin: 0;
	font-family: sans-serif;
	display: flex;
	height: 100vh;
	color: var(--textoOscuro);
}

/* estilo para el contenedor principal */
.app-container {
	display: flex;
	width: 100%;
	height: 100%;
}

/* estilo para el menú lateral */
.sidebar {
	width: 250px;
	background: var(--fondo1);
	color: var(--textoClaro);
	padding: 1rem;
	overflow-y: auto;
	transition: transform 0.3s ease;
	z-index: 1000;
}

/* Overlay para móvil */
.sidebar-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 999;
}

.sidebar-overlay.active {
	display: block;
}

/* Botón de menú */
.menu-toggle {
	display: none;
	background: none;
	border: none;
	color: var(--textoClaro);
	font-size: 1.5rem;
	cursor: pointer;
	padding: 0.5rem;
	margin-right: 1rem;
}

/* estilo para los enlaces del sidebar */
.sidebar a {
	color: var(--textoClaro);
	text-decoration: none;
	display: block;
	opacity: 0.9;
}

.sidebar a:hover {
	text-decoration: underline;
	color: var(--textoColor);
	opacity: 1;
}

/* estilo para agrupaciones del menú */
.menu-group {
	margin-bottom: 0.5rem;
}

.menu-group h3 {
	font-size: 0.9rem;
	padding: 0.75rem 1rem;
	margin: 0;
	color: var(--textoClaro);
	background: rgba(255, 255, 255, 0.05);
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-radius: 6px;
	transition: all 0.2s ease;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 600;
}

.menu-group h3:hover {
	background: rgba(255, 255, 255, 0.1);
}

.menu-group h3::after {
	content: '▾';
	font-size: 0.8rem;
	transition: transform 0.3s ease;
}

.menu-group.collapsed h3::after {
	transform: rotate(-90deg);
}

.menu-group ul {
	list-style: none;
	padding: 0.25rem 0 0.5rem 1rem;
	margin: 0;
	overflow: hidden;
	transition: max-height 0.3s ease-out;
}

.menu-group.collapsed ul {
	max-height: 0 !important;
	padding-top: 0;
	padding-bottom: 0;
}

.menu-group ul li a {
	font-size: 0.9rem;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	margin: 2px 0;
}

/* estilo para el área de contenido principal */
.main-area {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--textoClaro);
	/* Blanco según tu imagen */
}

#main-header-title {
	color: var(--textoClaro);
}

/* estilo para el encabezado */
.header {
	background: var(--fondo1);
	padding: 0.8rem 1.5rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	display: flex;
	align-items: center;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	z-index: 10;
	position: relative;
}

.header h1 {
	margin: 0;
	font-size: 1.4rem;
	color: var(--textoClaro);
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 10px;
}

/* Media queries para modo responsivo */
@media (max-width: 768px) {
	.sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		transform: translateX(-100%);
		width: 280px;
	}

	.sidebar.active {
		transform: translateX(0);
	}

	.menu-toggle {
		display: block;
	}

	.header {
		padding: 0.5rem 1rem;
	}

	.header h1 {
		font-size: 1.2rem;
	}
}

/* estilo para el contenido dinámico */
.content {
	flex: 1;
	padding: 0.8rem;
	overflow-y: auto;
}

/* Tooltips de ayuda */
.help-tooltip {
	position: relative;
	display: inline-flex;
	margin-left: 6px;
	cursor: help;
}

.help-icon {
	background: var(--textoOscuro);
	color: var(--textoClaro);
	width: 16px;
	height: 16px;
	border-radius: 50%;
	font-size: 11px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	transition: background 0.2s;
}

.help-tooltip:hover .help-icon {
	background: var(--color1);
}

.help-content {
	visibility: hidden;
	width: 200px;
	background-color: var(--textoOscuro);
	color: var(--textoClaro);
	text-align: center;
	border-radius: 6px;
	padding: 8px;
	position: absolute;
	z-index: 100;
	bottom: 125%;
	left: 50%;
	margin-left: -100px;
	opacity: 0;
	transition: opacity 0.3s;
	font-size: 0.8rem;
	font-weight: normal;
	line-height: 1.4;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	pointer-events: none;
}

.help-content::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -5px;
	border-width: 5px;
	border-style: solid;
	border-color: var(--textoOscuro) transparent transparent transparent;
}

.help-tooltip:hover .help-content {
	visibility: visible;
	opacity: 1;
}

.required-star {
	color: var(--textoColor);
	font-size: 1.2rem;
	line-height: 1;
	margin-left: 2px;
}

/* estilo para el pie de página */

/* estilos para formulario de login */
.login-container {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100vh;
	width: 100%;
	background: var(--textoOscuro);
	/* O algún color del sistema */
}

.login-box {
	background: var(--textoClaro);
	padding: 2rem;
	border-radius: 8px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
	width: 300px;
}

.login-box h2 {
	margin-top: 0;
	text-align: center;
	color: var(--color1);
}

.login-box label {
	display: block;
	margin-bottom: 0.5rem;
}

.login-box input {
	width: 100%;
	margin-bottom: 1rem;
	padding: 0.5rem;
	box-sizing: border-box;
}

.login-box button {
	width: 100%;
	padding: 0.5rem;
	background: var(--color1);
	color: var(--textoClaro);
	border: none;
	cursor: pointer;
	border-radius: 4px;
}

.login-box button:hover {
	background: var(--color2);
}

/* Clases de Utilidad para Controles */
.check-wrapper {
	display: flex;
	align-items: center;
	height: 38px;
}

/* Switch Toggle Moderno */
.switch-toggle {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 24px;
}

.switch-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider-round {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--textoOscuro);
	transition: .4s;
	border-radius: 34px;
}

.slider-round:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: var(--textoClaro);
	transition: .4s;
	border-radius: 50%;
}

.switch-toggle input:checked+.slider-round {
	background-color: var(--color2);
}

.switch-toggle input:focus+.slider-round {
	box-shadow: 0 0 1px var(--color2);
}

.switch-toggle input:checked+.slider-round:before {
	transform: translateX(22px);
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}

::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.05);
	border-radius: 10px;
}

::-webkit-scrollbar-thumb {
	background: var(--color1);
	border-radius: 10px;
	border: 2px solid transparent;
	background-clip: padding-box;
	cursor: pointer !important;
}

::-webkit-scrollbar-thumb:hover {
	filter: brightness(1.1);
}

::-webkit-scrollbar-thumb:active {
	cursor: grabbing !important;
}

.modern-table tr:hover td {
	background-color: rgba(var(--color1-rgb), 0.12) !important;
	border-bottom: 1px solid rgba(var(--color1-rgb), 0.3);
}