:root {
	--letra-familia: arial, helvetica, sans-serif;
	
	--tabla-borde: 1px solid #bbb;	
	--tabla-fondo: #fff;
	
	--campo-fondo-desabilitado: #fcfcfc;
	
	--campo-borde: 1px solid #88f;
	--campo-borde-desabilitado: 1px solid #ccc;
	--campo-borde-boton: 1px solid #ccc;
	
	--campo-color: #000;
	--campo-color-desabilitado: #000;
	
	--campo-redondeo: 5px;
}

* { box-sizing: border-box; }
body { 
	margin: 0px; padding: 0px; background-color: #eee;
	font-family: var(--letra-familia); font-size: 16px; color: #111; letter-spacing: .2px;
}
a, a:visited { color: blue; text-decoration: none; }
a:hover { color: darkblue; text-decoration: underline; }
small { font-size: 14px; }

h1 { font-size: 24px; }
h2 { font-size: 22px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

button,
button[type=button],
.boton,
a.boton,
input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[list],
input[type=submit],
input[type=reset],
select,
textarea,
label:has(input) {
	min-width: 37px; min-height: 37px;
	border: var(--campo-borde); border-radius: var(--campo-redondeo); 
	font-family: var(--letra-familia); letter-spacing: .3px; text-decoration: none;
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[list] { font-size: 16px; }

label:has(input[disabled]),
input[disabled] {
	background: var(--campo-fondo-desabilitado);
	border: var(--campo-borde-desabilitado);
}

.boton,
a.boton,
button,
button[type=button],
input[type=submit],
input[type=reset] {
	display: flex; justify-content:center; align-items: center;
	padding: 0px 14px;
	background-color: #eee; border: var(--campo-borde-boton);
	font-size: 14px; color: #000; text-decoration: none;
	cursor: pointer;
	svg {
		height: 16px;
		fill: #6f6f6f;
	}
}

.boton:hover,
a.boton:hover,
button:hover,
input[type=submit]:hover,
input[type=reset]:hover {
	background-color: #eef;
}

.boton.regresar{
	background-color: #fff;
	&:hover{
		background-color: #eef;
	}
}

.boton.cancelar {
	background-color: #fee;
	&:hover{
		background-color: #fee;
		color: #f00;
	}
}

input[type=reset] {
	background-color: #fff;
	&:hover{
		background-color: #efe;
		color: #060;
	}
}

.boton.nuevo {
	background-color: #fff;
	color: #00f;
}

.boton.editar {
	background-color: #fff;
	color: #000;
	&:hover {
		color: #00f;
	}
}

input[type=submit].guardar {
	background-color: #44f;
	border-color: #22f;
	color: #fff;
	&:hover{
		background-color: #00f;
	}
}

.boton.eliminar {
	background-color: #fff;
	color: #000;
	&:hover {
		background-color: #fee;
		color: #f00;
	}
}

input[type=submit].eliminar {
	background-color: #e11;
	color: #fff;
	&:hover {
		background-color: #f11;
	}
}

.boton-texto {
	height: 37px;
	display: flex; justify-content: center; align-items: center;
	padding: 0px 10px; 
	border: var(--campo-borde); border-color: transparent; border-radius: var(--campo-redondeo); 
	font-size: 16px;
}
.boton-texto.inactivo {
	border-color: #bbb;
	svg {
		fill: #b3b3b3;
	}
}
.boton-texto.titulo {
	font-weight: bold;
	font-size: 18px;
}

span.boton-texto {
	min-width: 38px;
	svg {
		height: 16px;
		fill: #6f6f6f;
	}
}

.boton.actual,
.boton.actual:hover { background-color: #2a2; color: #fff; cursor: default; }

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[list] {
	padding: 0px 10px 0px;
}

/* SELECT */

select {
	background-color: #fff;
	height: 37px; padding: 0px 5px;
	border: var(--campo-borde);
	font-size: 16px; color: #000;
}
select[disabled] {
	background: var(--campo-fondo-desabilitado); 
	border: var(--campo-borde-desabilitado);
	color: var(--campo-color-desabilitado);
}

/* TEXTAREA */

textarea {
	height: auto; padding: 6px 10px; 
	resize: none; font-size: 16px;
}

input[type=text]:disabled,
input[type=email]:disabled,
input[type=password]:disabled,
input[type=number]:disabled,
input[list]:disabled,
textarea:disabled	{ color: #333; }

label {
	&:has(input){
		display: flex; justify-content: flex-start; align-content: center;
		cursor: pointer;
		user-select: none; -webkit-user-select: none; -ms-user-select: none;
		
		input {
			margin: 0px 6px 0px 9px; padding: 0px; 
		}
		span {
			display: flex; flex-wrap: wrap; align-content: center; margin-right: 10px; font-size: 15px;
		}
	}
	&:has(input:checked) {
		background-color: #beb;
		color: #000;
		accent-color: #494;
	}
}

/* label:has(input:checked) { background-color: #292; border-color: #1b1;color: #fff; accent-color: #495; } */
label:has(input:not(:checked)) { background-color: #fff; }
label:has(input:not(:checked)):has(input:not(:disabled)):hover { /* background-color: #28e;  color: #fff; */
background-color: #eef; }

svg { fill: #bbb; }
.activo svg { fill: #0b0; /* fill: #0c0; */ }

/* MAQUETACIÓN */

main { padding: 10px; }
main > article { width: 100%; display: grid; grid-template-columns: auto; justify-content: center; }
main > article > div {  }

.caja { background-color: #fff; border: 1px solid #333; border-radius: 8px; }
.caja > header,
.caja > footer { display: grid; grid-template-columns: auto auto; justify-content: space-between; }
.caja > header > div,
.caja > footer > div { padding: 6px; }
.caja > header > div > *,
.caja > footer > div > * { 
	display: flex; justify-content: center; align-items: center;
	margin: 6px; border-radius: 5px;
}
.caja > header > div > * { min-height: 29px; padding: 2px 7px; }
.caja > footer > div > * { min-height: 34px; padding: 2px 10px; }
.caja ul { margin: 7px 0px 0px 0px; padding-left: 21px; }
.caja li { padding: 7px 0px; }
.caja li:last-child { padding-bottom: 0px; }
.caja > ul { margin: 15px; margin-top: 0px; }

.modal { 
	display: none; justify-content: center; align-items: center;
	position: fixed; top: 0px; right: 0px; bottom: 0px; left: 0px; z-index: 1;
	background-color: #111b;
}
.modal > button {
	position: absolute; top: 0; right: 0;
	background: none; border: none;
	margin: 0px; padding: 0px 6px 0px 0px;
	color: #ddd; font-size: 50px;
	cursor: pointer;
}

.modal > iframe {
	width: 100%;
	height: 100%;
	border: none;
}

#modal-principal { flex-wrap: wrap; justify-content: flex-end; align-items: flex-start;
	padding: 10px; overflow: auto; }

#modal-usuario { 
	flex-wrap: wrap; justify-content: flex-end; align-items: flex-start;
	padding: 10px;
}

table.registros,
table.formulario {
	border-collapse: collapse;
	caption {
		background-color: var(--tabla-fondo);
		border: var(--tabla-borde); border-bottom: none;
		> div {
			display: flex; flex-wrap: wrap; justify-content: space-between;
			> div {
				padding: 6px 7px;
				display: flex; flex-wrap: wrap;
				> * {
					margin: 7px;
					display: flex; justify-content: center; align-items: center;
				}
			}
		}
	}
}

table.registros {
	border-collapse: collapse;
	background-color: #fff;
	
	th,
	td {
		border: var(--tabla-borde);
	}
	
	thead {
		background: var(--tabla-fondo);
		th {
			> div {
				display: flex; justify-content: center; align-items: stretch; min-height: 49px;
				> * {
					display: flex; align-items: center; padding: 0px 1px;
				}
				> a {
					padding-left: 6px;
					svg {
						height: 20px;
					}
				}
				> a.activo {
					svg { height: 20px; }
				}
				> span { padding: 0 6px; color: #777; }
				> div {
					padding-right: 6px;
					cursor: pointer;
					svg { height: 20px; }
				}
			}
		}			
	}
	
	tbody {
		tr {
			td {
				padding: 17px 12px;
			}
		}
		tr:hover {
			background-color: #f3f3ff;
		}
		td {
			span.verde { color: #060; }
			span.rojo { color: #a55; }
		}
		div.etiqueta { display: none; }
	}
	
	tfoot {
		background-color: var(--tabla-fondo);
		
		td.paginacion {
			
			> div {
				display: flex; flex-wrap: wrap; justify-content: space-between; align-items: stretch;
				
				> div {
					display: flex; flex-wrap: wrap; align-items: stretch;
					padding: 5px;
					label { 
						display: flex; justify-content: center; align-items: center;
						font-size: 14px;
					}
					input[type=number] {
						width: 90px;
					}
					> * { margin: 5px; }
				}
			}
		}
	}
}

table.formulario {
	border-collapse: collapse;
	border: var(--tabla-borde);
	background-color: #fff;
	colgroup {
		* { box-sizing: border-box; }
		col { vertical-align: top; }
		col:nth-child(odd) { width: 150px; }
		col:nth-child(even) { width: 340px; }
	}
	th {
		padding: 16px 12px 0px; border-top: var(--tabla-borde);
		font-size: 16px; color: #707070; letter-spacing: .5px;
	}
	tbody {
		td { padding: 10px 20px; }
		td.ajuste { padding-bottom: 5px; }
	}
	
	button,
	.boton,
	a.boton,
	input[type=text],
	input[type=password],
	input[type=number],
	input[type=email],
	input[list],
	select,
	textarea { width: 100%; }
	
	span.boton { width: auto; }
	
	label:not(:has(input)) { color: darkred; }
	
	hr { display: block; height: 1px; border: 0; border-top: var(--tabla-borde); padding: 0; }
	
	td.tab-1 { padding-left: 35px; }
	td.tab-2 { padding-left: 55px; }
	td.tab-3 { padding-left: 75px; }
	td.tab-4 { padding-left: 95px; }
	td.tab-5 { padding-left: 115px; }
	td.tab-6 { padding-left: 135px; }
	td.tab-7 { padding-left: 155px; }
	td.tab-8 { padding-left: 175px; }
	td.tab-9 { padding-left: 195px; }
	
	.monoespaciado { padding: 6px 8px; font-family: monospace; font-size: 17.2px; letter-spacing: 0px; }
	.serifa { font-family: serif; font-size: 20px; }
	
	.mini { width: 50px; }
	.chico { width: 100px; max-width: 100%; }
	.mediano { width: 200px; max-width: 100%; }
	
	.flex { display: flex; flex-wrap: wrap; }
	.flex > * { margin-right: 10px; margin-bottom: 2px; }
}

table.formulario.cuadricula {
	colgroup {
		col { width: 160px; }
	}
	
	th {
		padding: 18px 12px; border: none;
		font-size: 16px; color: #707070; letter-spacing: .5px;
	}
	
	tbody {
		td { padding: 12px 11px; }
		td:first-child { padding-left: 22px; }
		td:last-child { padding-right: 22px; }
		
		tr.ultima-fila {
			td {
				padding: 6px;
			}
		}
	}
	
	label:has(input) { width: 100%; }
}

table.registros,
table.formulario,
table.formulario.cuadricula {
	caption,
	tfoot {
		background-color: var(--tabla-fondo); border-top: var(--tabla-borde);
		> div,
		td > div {
			display: flex; flex-wrap: wrap; justify-content: space-between;
			> div {
				padding: 7px;
				display: flex; flex-wrap: wrap; justify-content: space-between; align-content: center;
				> * {
					margin: 7px;
				}
				input[type=submit],
				input[type=reset] { letter-spacing: .4px; }
			}
		}
	}
}


@media ( max-width: 1050px ){
	main > article { justify-content: stretch; }
	
	article > div {
		width: 100%;
	}
	
	table.registros,
	table.formulario {
		width: 100%; min-width: auto; 
		th, td { display: block; }
		td.vacio { display: none; }
		div.etiqueta { display: block; padding-bottom: 6px; }
		colgroup {
			* { box-sizing: border-box; }
			col { min-width: auto; }
			col:nth-child(odd) { width: auto; }
			col:nth-child(even) { width: auto; }
		}
		colgroup.cuadricula {
			* { box-sizing: border-box; }
			col { width: auto; }
			col:nth-child(odd) { width: auto; }
			col:nth-child(even) { width: auto; }
		}
	}
	
	table.formulario.cuadricula {
		
		th {
			padding: 24px 12px 6px; border: none;
		}
		
		tbody {
			/* para eliminar borde inforior de los labels */
			td:first-child { padding-bottom: 0px; } 
			
			td:first-child { padding-left: 15px; padding-top: 25px; }
			td:last-child { padding-right: 11px; }
			
			.medio { width: 300px; }
		}
	}
	
	table.registros {
		th, td {
			display: block; 
			border-bottom: none;
		}
		tbody {
			tr {
				border-top: var(--tabla-borde);
				td {
					padding-bottom: 0px;
					border-top: none;
					div.etiqueta { 
						display: block; padding-bottom: 6px;
					}
				}
				td.vacio { display: none; }
				td:last-child { padding-bottom: 11px; }
			}
			th:first-child { border-top: none; }
			tr:hover {
				background: transparent;
			}
		}	
	}
}

@media ( max-width: 500px ){
	table.formulario.cuadricula {
		tbody {
			.medio { width: 100%; }
		}
	}
}

body > header {
	display: flex; justify-content: space-between; align-items: stretch;
	background: #efefff; background: linear-gradient(#666, #555);
	border-bottom: 1px solid #ccc;
	/* height: 48px; */
	
	ul {
		list-style-type: none; margin: 0px; padding: 0px;
	}
	
	> * {
		display: flex; align-items: stretch;
	}
	
	#logotipo {
		display: flex; justify-content: center; align-items: center;
		color: #ddd; font-size: 15px; line-height: 17px;
		
		picture {
			padding: 0px;
			display: flex; align-items: stretch;
			img {
				height: 29px; margin: 0px 7px 0px 13px;
			}
		}
		div {
			padding-right: 11px;
		}
	}
	
	#logotipo:hover {
		background-color: #555;
		color: #fff; text-decoration: none;
	}
	
	#navegacion-menu {
		a {
			color: #ddd; text-decoration: none;
		}
		a:hover {
			color: #fff;
		}
		> * > * {
			padding: 2px 5px;
		}
		> li {
			display: flex; align-items: stretch;
			position: relative;
			> * {
				display: flex; justify-content: center; align-items: center;
			}
			ul {
				display: none; position: absolute; top: 100%;
				padding: 0px; background-color: #555; border: 1px solid #777;
				font-size: 15px;
				> li {
					position: relative;
					a,
					div {
						display: block; padding: 15px 13px; white-space: nowrap; hyphens: none;
					}
					div {
						cursor: default;
					}
					> ul {
						top: 0px; left: 100%;					
					}
				}
			}
		}
		
		> li:hover {
			* { box-sizing: border-box; } /* ajuste */
			> ul {
				display: block;
				li:hover {
					background: #444;
					> ul {
						display: block;
					}
				}
			}
		}
	}
	
	#navegacion-botones {
		justify-content: flex-end;
		button {
			display: flex; justify-content: center; align-items: center;
			width: 52px; height: 52px; background: none; padding: 0px; border: none;
			cursor: pointer;
		}
		button#boton-principal { display: none; }
		button {
			svg {
				height: 22px;
				path {
					fill: #ccc;
				}
			}
			svg:hover {
				path {
					fill: #3c3;
				}
			}
		}
	}
	
}

@media ( max-width: 1100px ){
	body > header {
		#navegacion-menu { display: none; }
		#navegacion-botones {
			button#boton-principal { display: flex; }
		}
	}
}

#migas {
	padding: 9px 12px 0px; line-height: 30px;
	a {
		margin: 0px 2px;
	}
}
