/* =============================================================
   Identidad visual — Colegio Santa Teresa de Jesús Sophianum
   =============================================================
   Paleta oficial. El amarillo NUNCA como texto: sobre blanco no
   llega al contraste AA y en una pantalla de sala de profesores con
   luz de ventana no se lee. Se usa solo como fondo o filete.
   ============================================================= */

:root {
	/* Paleta tomada de los campos del escudo: azul noche, índigo,
	   amarillo, rojo y verde. El azul sostiene la navegación; el rojo
	   marca acciones y estados importantes sin convertir la interfaz en
	   una página roja. */
	--azul: #313053;
	--azul-claro: #5f618c;
	--verde: #006044;
	--amarillo: #f0e300;
	--rojo: #e62227;

	--vino-oscuro: #1f2038;
	--vino: #e62227;
	--vino-suave: #b14b56;
	--oro-suave: #fff8b0;
	--tinta: #25243a;
	--tinta-suave: #606275;
	--linea: #dfe1eb;
	--fondo: #f7f8fc;
	--papel: #ffffff;

	--radio: 12px;
	--sombra: 0 1px 3px rgb(31 32 56 / 7%), 0 10px 28px rgb(31 32 56 / 6%);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--tinta);
	background:
		radial-gradient(circle at 8% 0%, rgb(240 227 0 / 9%), transparent 24rem),
		linear-gradient(135deg, rgb(230 34 39 / 2%) 0 1px, transparent 1px 18px),
		var(--fondo);
}

button,
input,
select,
textarea {
	font-family: inherit;
}

a {
	color: var(--vino);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 3px solid rgb(240 227 0 / 80%);
	outline-offset: 2px;
}

/* --- Barra superior --- */
.barra {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: 68px;
	padding: 0.65rem 1.25rem;
	background: linear-gradient(110deg, var(--vino-oscuro), var(--azul));
	color: #fff;
	border-bottom: 4px solid var(--amarillo);
	box-shadow: 0 4px 18px rgb(31 32 56 / 14%);
}

.barra-marca {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-width: max-content;
}

.barra-marca img {
	display: block;
	width: 43px;
	height: 49px;
	object-fit: contain;
	filter: drop-shadow(0 2px 3px rgb(0 0 0 / 18%));
}

.barra-marca strong,
.barra-marca small { display: block; }
.barra-marca strong { font-size: 0.82rem; letter-spacing: 0.02em; }
.barra-marca small { margin-top: 0.05rem; font-size: 0.65rem; color: #fff27a; letter-spacing: 0.1em; text-transform: uppercase; }

.barra h1 {
	margin: 0;
	padding-left: 1rem;
	border-left: 1px solid rgb(255 255 255 / 25%);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.barra-inicio {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 0.3rem 0.65rem;
	border: 1px solid rgb(255 255 255 / 26%);
	border-radius: 7px;
	color: rgb(255 255 255 / 82%);
	font-size: 0.78rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.barra-inicio:hover {
	border-color: var(--amarillo);
	background: rgb(240 227 0 / 13%);
	color: #fff;
}

.barra .quien {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin-left: auto;
	font-size: 0.9rem;
	opacity: 1;
}

.quien-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border: 1px solid rgb(240 227 0 / 65%);
	border-radius: 50%;
	background: var(--oro-suave);
	color: var(--vino-oscuro);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.02em;
}

.quien-datos {
	display: grid;
	gap: 0.02rem;
	line-height: 1.12;
}

.quien-datos small {
	color: rgb(255 255 255 / 62%);
	font-size: 0.63rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.quien-datos strong {
	max-width: 220px;
	overflow: hidden;
	color: #fff;
	font-size: 0.84rem;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.quien-datos em {
	width: max-content;
	padding: 0.08rem 0.35rem;
	border-radius: 999px;
	background: rgb(240 227 0 / 18%);
	color: #fff27a;
	font-size: 0.65rem;
	font-style: normal;
	font-weight: 700;
}

.barra button {
	background: transparent;
	border: 1px solid rgb(255 255 255 / 45%);
	color: #fff;
	padding: 0.35rem 0.8rem;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.85rem;
}

.barra button:hover {
	background: rgb(240 227 0 / 15%);
	border-color: var(--amarillo);
}

@media (max-width: 680px) {
	.barra { align-items: flex-start; flex-wrap: wrap; }
	.barra h1 { order: 3; width: 100%; padding: 0.35rem 0 0; border-left: 0; border-top: 1px solid rgb(255 255 255 / 22%); }
	.barra .quien { margin-left: auto; }
	.quien-datos strong { max-width: 145px; font-size: 0.78rem; }
}

/* --- Estructura --- */
main {
	max-width: 1100px;
	margin: 0 auto;
	padding: 1.5rem 1.25rem 4rem;
}

.tarjeta {
	background: var(--papel);
	border: 1px solid var(--linea);
	border-radius: var(--radio);
	box-shadow: var(--sombra);
	padding: 1.25rem;
	margin-bottom: 1.25rem;
}

.tarjeta h2 {
	margin: 0 0 0.25rem;
	font-size: 1.05rem;
	color: var(--azul);
}

.tarjeta .pie {
	margin: 0 0 1rem;
	color: var(--tinta-suave);
	font-size: 0.88rem;
}

/* --- Cifras --- */
.cifras {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 0.9rem;
	margin-bottom: 1.25rem;
}

.cifra {
	background: var(--papel);
	border: 1px solid var(--linea);
	border-left: 4px solid var(--verde);
	border-radius: var(--radio);
	padding: 0.9rem 1rem;
}

.cifra b {
	display: block;
	font-size: 1.8rem;
	line-height: 1.1;
	color: var(--azul);
}

.cifra span {
	font-size: 0.82rem;
	color: var(--tinta-suave);
}

/* --- Tablas --- */
.tabla-envoltura {
	overflow-x: auto;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
}

th,
td {
	text-align: left;
	padding: 0.55rem 0.6rem;
	border-bottom: 1px solid var(--linea);
}

th {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tinta-suave);
	background: #fffaf0;
	position: sticky;
	top: 0;
}

tbody tr:hover {
	background: #fffaf0;
}

/* --- Formularios --- */
label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
	color: var(--tinta);
}

input,
select,
textarea {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--linea);
	border-radius: 8px;
	font: inherit;
	background: #fff;
	color: var(--tinta);
}

input:focus,
select:focus,
textarea:focus {
	outline: 2px solid var(--verde);
	outline-offset: 1px;
	border-color: var(--verde);
}

.fila {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 0.9rem;
	margin-bottom: 0.9rem;
}

button.principal,
a.principal {
	background: var(--verde);
	color: #fff;
	border: 0;
	padding: 0.6rem 1.2rem;
	border-radius: 8px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

button.principal:hover,
a.principal:hover {
	background: var(--vino-oscuro);
}

button.principal:disabled {
	background: #c9a0a3;
	cursor: not-allowed;
}

button.principal,
a.principal,
button.menor,
a.menor {
	text-decoration: none;
}

a.principal {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

button.menor,
a.menor {
	background: #fff;
	border: 1px solid var(--linea);
	padding: 0.35rem 0.7rem;
	border-radius: 6px;
	font-size: 0.82rem;
	cursor: pointer;
}

button.menor:hover,
a.menor:hover {
	border-color: var(--verde);
	color: var(--verde);
}

.acciones {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	flex-wrap: wrap;
}

.ancho-completo {
	grid-column: 1 / -1;
}

[hidden] {
	display: none !important;
}

/* --- Avisos --- */
.aviso {
	padding: 0.75rem 1rem;
	border-radius: 8px;
	font-size: 0.9rem;
	margin-bottom: 1rem;
	border-left: 4px solid;
}

.aviso.info {
	background: #fff8b0;
	border-color: var(--vino);
	color: #313053;
}

.aviso.ojo {
	background: #fffbe0;
	border-color: var(--amarillo);
	color: #6b5600; /* texto oscuro: el amarillo solo hace de filete */
}

.aviso.mal {
	background: #fdeded;
	border-color: var(--rojo);
	color: #96161b;
}

.etiqueta {
	display: inline-block;
	padding: 0.12rem 0.5rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 600;
	background: #eef1f5;
	color: var(--tinta-suave);
}

.etiqueta.si {
	background: #fff8b0;
	color: #6b5010;
}

.etiqueta.no {
	background: #fdeded;
	color: #96161b;
}

.vacio {
	padding: 2rem 1rem;
	text-align: center;
	color: var(--tinta-suave);
	font-size: 0.92rem;
}

.codigo {
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 1.4rem;
	letter-spacing: 0.08em;
	background: var(--azul);
	color: #fff;
	padding: 0.5rem 0.9rem;
	border-radius: 8px;
	display: inline-block;
}

/* --- Cabeceras institucionales --- */
.vista-kicker {
	margin-bottom: 0.35rem;
	color: var(--vino);
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.vista-cabecera {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.vista-cabecera h1,
.vista-cabecera h2 {
	margin: 0 0 0.3rem;
	color: var(--vino-oscuro);
	font: 500 clamp(1.75rem, 3vw, 2.7rem)/1.05 Georgia, "Times New Roman", serif;
	letter-spacing: -0.035em;
}

.vista-cabecera p {
	max-width: 720px;
	margin: 0;
	color: var(--tinta-suave);
}

.ruta-pasos {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin-bottom: 1rem;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--linea);
	border-left: 4px solid var(--amarillo);
	border-radius: 9px;
	background: #fffdf4;
	color: var(--tinta-suave);
	font-size: 0.76rem;
	overflow-x: auto;
}

.ruta-pasos strong {
	color: var(--vino-oscuro);
	white-space: nowrap;
}

.ruta-pasos span {
	padding-left: 0.6rem;
	border-left: 1px solid #eadfb7;
	white-space: nowrap;
}

/* --- Panel de Dirección --- */
.direccion-main {
	max-width: 1240px;
}

.direccion-hero {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
	margin-bottom: 1rem;
	padding: 1.8rem 2rem;
	border-radius: 16px;
	border-bottom: 5px solid var(--amarillo);
	background: linear-gradient(118deg, var(--vino-oscuro), var(--vino));
	box-shadow: 0 14px 30px rgb(31 32 56 / 14%);
	color: #fff;
}

.direccion-hero .vista-kicker {
	color: #fff27a;
}

.direccion-hero h1 {
	max-width: 700px;
	margin: 0 0 0.45rem;
	color: #fff;
	font: 500 clamp(2rem, 4vw, 3.5rem)/1.02 Georgia, "Times New Roman", serif;
	letter-spacing: -0.04em;
}

.direccion-hero p {
	max-width: 680px;
	margin: 0;
	color: rgb(255 255 255 / 78%);
}

.direccion-sello {
	display: grid;
	gap: 0.15rem;
	min-width: 190px;
	padding: 0.8rem;
	border: 1px solid rgb(240 227 0 / 50%);
	border-radius: 10px;
	background: rgb(31 32 56 / 24%);
}

.direccion-sello strong {
	color: #fff27a;
	font-size: 0.78rem;
}

.direccion-sello span {
	color: rgb(255 255 255 / 70%);
	font-size: 0.73rem;
}

.direccion-metricas .cifra {
	border-top: 3px solid var(--vino);
	border-left: 0;
}

.direccion-metricas .cifra:nth-child(2) { border-top-color: var(--amarillo); }
.direccion-metricas .cifra:nth-child(3) { border-top-color: var(--verde); }
.direccion-metricas .cifra:nth-child(4) { border-top-color: var(--rojo); }

.direccion-seccion {
	border-top: 4px solid var(--amarillo);
}

.direccion-seccion h2,
.direccion-proceso h2 {
	color: var(--vino-oscuro);
}

.direccion-accesos {
	display: inline-block;
	width: calc(50% - 0.65rem);
	margin-right: 1rem;
	vertical-align: top;
}

.direccion-accesos + .direccion-accesos {
	margin-right: 0;
}

.direccion-proceso {
	border-left: 5px solid var(--vino);
}

.direccion-proceso .vista-cabecera {
	align-items: flex-start;
	margin-bottom: 0.9rem;
}

.direccion-proceso-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.65rem;
}

.direccion-proceso-grid div {
	display: grid;
	gap: 0.2rem;
	padding: 0.75rem;
	border: 1px solid var(--linea);
	border-radius: 9px;
	background: #fffdfb;
}

.direccion-proceso-grid strong {
	color: var(--vino);
	font-size: 0.84rem;
}

.direccion-proceso-grid span {
	color: var(--tinta-suave);
	font-size: 0.76rem;
	line-height: 1.35;
}

@media (max-width: 680px) {
	.barra-inicio { order: 4; }
	.vista-cabecera { align-items: flex-start; flex-direction: column; }
	.vista-cabecera .acciones { width: 100%; }
	.vista-cabecera .acciones > * { flex: 1 1 auto; }
	.fila { grid-template-columns: 1fr; }
	.ancho-completo { grid-column: auto; }
	.direccion-hero { align-items: flex-start; flex-direction: column; padding: 1.35rem; }
	.direccion-sello { width: 100%; }
	.direccion-accesos { display: block; width: auto; margin-right: 0; }
	.direccion-proceso-grid { grid-template-columns: 1fr; }
}
