/* =========================================
   COMPONENTS.CSS - Elementos de Interfaz
   ========================================= */

/* --- 1. Botones Base y Variantes --- */
button,
.btn {
	padding: 0.5rem 1rem;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: none;
	font-size: 0.9rem;
	display: inline-block;
	transition: opacity 0.2s;
}

.btn:hover {
	opacity: 0.8;
}

.btn-primary {
	background: #3794ff;
	color: #fff;
}

.btn-danger {
	background: #d32f2f;
	color: #fff;
}

.btn-success {
	background: #388e3c;
	color: #fff;
}

.btn-download {
	background: #089981;
	color: #fff;
}

/* Alineación específica para botones */
.btn-self-start {
	align-self: flex-start;
}

/* --- 2. Botones de Icono (Acciones de tabla/tarjetas) --- */
.btn-icon {
	background: transparent !important;
	border: none !important;
	padding: 6px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #a1a1aa;
	transition:
		color 0.2s ease,
		transform 0.1s ease;
}

.btn-icon:active {
	transform: scale(0.9);
}

.btn-icon.hover-primary:hover {
	color: #8b5cf6; /* Morado para Visualizar */
}

.btn-icon.hover-success:hover {
	color: #10b981; /* Verde para Descargar */
}

.btn-icon.hover-warning:hover {
	color: #f59e0b; /* Naranja para Editar */
}

.btn-icon.hover-danger:hover {
	color: #ef4444; /* Rojo para Eliminar */
}

.btn-icon svg {
	width: 20px;
	height: 20px;
}

/* --- 3. Formularios: Estructura Global --- */
.form-row {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
	align-items: flex-end;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.form-group label {
	font-size: 0.9rem;
	color: #bbb;
	font-weight: 500;
}

/* --- 4. Formularios: Inputs y Controles --- */
.input-text,
.input-file {
	width: 100%;
	background-color: #252526;
	border: 1px solid #444;
	color: #e0e0e0;
	border-radius: 6px;
	box-sizing: border-box;
}

.input-text:focus,
.input-file:focus {
	outline: none;
	border-color: #3794ff;
}

.input-readonly {
	flex: 1;
	padding: 0.5rem;
	border: 1px solid #388e3c;
	background: #1e1e1e;
	color: #81c784;
}

/* --- 5. Tablas y Visualización de Datos --- */
table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 0;
}

th,
td {
	padding: 0.75rem;
	text-align: left;
	border-bottom: 1px solid #333;
}

th {
	background: #252526;
	color: #aaa;
	font-weight: 500;
	position: sticky;
	top: 0;
	z-index: 3;
	box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.5);
}

tr:hover td {
	background-color: #2a2a2a;
}

.mobile-text {
	font-weight: bold;
	display: none;
}

/* --- 6. Utilidades Específicas de Formulario/Layout --- */
.flex-1 {
	flex: 1;
	min-width: 150px;
}

.flex-2 {
	flex: 2;
	min-width: 250px;
}

.margin-top-1 {
	margin-top: 1rem;
}

/* =========================================
   VERSIÓN MÓVIL
   ========================================= */
@media (max-width: 900px) {
	table thead {
		display: none;
	}

	table,
	tbody,
	tr,
	td {
		display: block;
		width: 100%;
	}

	table tbody tr {
		background-color: #1e1e1e;
		margin-bottom: 1.5rem;
		border-radius: 12px;
		border: 1px solid #333;
		padding: 1rem;
		box-sizing: border-box;
	}

	tr:hover td {
		background-color: transparent;
	}

	table td {
		padding: 0.5rem 0;
		border-bottom: none;
		text-align: center;
	}

	.mobile-text {
		display: inline;
	}
}
