/* Plataforma de Implementación ISO — QUALYTA. Estilos propios, sin dependencias. */
:root {
  --marca: #0b3954; --marca-2: #072a3f; --acento: #087e8b; --acento-2: #06656f;
  --fondo: #f3f5f8; --panel: #ffffff; --borde: #dbe2ea; --texto: #1b2733; --tenue: #5f6f80;
  --ok: #1f8a5b; --ok-f: #e2f4ec; --ambar: #a86a08; --ambar-f: #fdf1d9; --rojo: #b3362b; --rojo-f: #fbe6e3; --azul: #1f5f9c; --azul-f: #e3eefa; --gris-f: #edf0f4;
  --radio: 10px; --sombra: 0 1px 2px rgba(11, 57, 84, .06), 0 2px 8px rgba(11, 57, 84, .05);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--texto); background: var(--fondo); line-height: 1.5; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.3rem; } h2 { font-size: 1.05rem; } h3 { font-size: 1rem; } h4 { font-size: .95rem; margin: 1rem 0 .4rem; color: var(--marca); }
a { color: var(--acento-2); }
p { margin: 0 0 .7rem; }
small, .tenue { color: var(--tenue); }
:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }

/* Estructura */
body.con-menu { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.menu { background: var(--marca); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.marca { padding: 1.1rem 1.2rem .9rem; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.marca b { font-size: 1.5rem; letter-spacing: .5px; display: block; }
.marca span { font-size: .78rem; opacity: .8; }
.menu nav { padding: .7rem .6rem; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.menu nav a { color: #d7e3ec; text-decoration: none; padding: .55rem .7rem; border-radius: 8px; font-size: .93rem; display: flex; justify-content: space-between; align-items: center; }
.menu nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.menu nav a.activo { background: var(--acento); color: #fff; font-weight: 600; }
.menu nav a i, .campana i { font-style: normal; background: #f2b705; color: #2b2100; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 0 .45rem; min-width: 1.3rem; text-align: center; }
.menu-pie { padding: .8rem; display: flex; flex-direction: column; gap: .35rem; }
.ia { font-size: .72rem; padding: .25rem .5rem; border-radius: 6px; background: rgba(255, 255, 255, .1); }
.ia.si { background: rgba(31, 138, 91, .35); } .ia.no { background: rgba(242, 183, 5, .25); }
.lienzo { min-width: 0; display: flex; flex-direction: column; }
.barra-superior { background: var(--panel); border-bottom: 1px solid var(--borde); padding: .7rem 1.4rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 5; }
.barra-superior .titulo { flex: 1; min-width: 0; }
.migas { font-size: .78rem; color: var(--tenue); } .migas a { color: var(--tenue); }
.usuario { display: flex; align-items: center; gap: 1rem; font-size: .85rem; }
.usuario a { text-decoration: none; color: var(--texto); } .usuario a b { display: block; } .usuario a small { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campana { display: flex; gap: .3rem; align-items: center; color: var(--acento-2) !important; font-weight: 600; }
.menu-boton { display: none; font-size: 1.4rem; cursor: pointer; padding: 0 .3rem; }
main { padding: 1.3rem 1.4rem 3rem; max-width: 1240px; width: 100%; }
main.centro { max-width: 460px; margin: 0 auto; padding-top: 7vh; } main.centro.ancho { max-width: 720px; }
.marca-grande { text-align: center; margin-bottom: 1.2rem; color: var(--marca); }
.marca-grande b { font-size: 2.4rem; display: block; } .marca-grande span { color: var(--tenue); }

/* Bloques */
.tarjeta { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1.1rem 1.2rem; margin-bottom: 1.1rem; }
.tarjeta > header { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .8rem; flex-wrap: wrap; }
.tarjeta > header h2 { color: var(--marca); }
.rejilla { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.rejilla > .tarjeta { margin-bottom: 0; } .rejilla { margin-bottom: 1.1rem; }
.datos { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1.1rem; }
.dato { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: .8rem 1rem; box-shadow: var(--sombra); border-left: 4px solid var(--acento); }
.dato strong { font-size: 1.55rem; display: block; color: var(--marca); line-height: 1.2; }
.dato span { font-size: .8rem; color: var(--tenue); }
.dato.ambar { border-left-color: #e0a422; } .dato.rojo { border-left-color: var(--rojo); } .dato.ok { border-left-color: var(--ok); }
.vacio { color: var(--tenue); font-style: italic; margin: .3rem 0; }
.fila { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.entre { display: flex; justify-content: space-between; gap: .8rem; align-items: center; flex-wrap: wrap; }
.lista-simple li.entre { flex-wrap: nowrap; }
.lista-simple { list-style: none; padding: 0; margin: 0; } .lista-simple li { padding: .55rem 0; border-bottom: 1px solid var(--borde); } .lista-simple li:last-child { border-bottom: 0; }
dl.ficha { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; } dl.ficha dt { color: var(--tenue); font-size: .88rem; } dl.ficha dd { margin: 0; }

/* Insignias, barras y avisos */
.insignia { display: inline-block; font-size: .74rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; white-space: nowrap; }
.insignia.ok { background: var(--ok-f); color: var(--ok); } .insignia.ambar { background: var(--ambar-f); color: var(--ambar); } .insignia.rojo { background: var(--rojo-f); color: var(--rojo); }
.insignia.azul { background: var(--azul-f); color: var(--azul); } .insignia.gris { background: var(--gris-f); color: var(--tenue); }
.barra { background: var(--gris-f); border-radius: 999px; height: 9px; overflow: hidden; margin: .3rem 0; }
.barra span { display: block; height: 100%; background: linear-gradient(90deg, var(--acento), #2bb3a3); border-radius: 999px; }
.aviso { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.aviso.ok { background: var(--ok-f); border-color: #b6e0cc; color: #145c3c; } .aviso.error { background: var(--rojo-f); border-color: #f0bdb7; color: #7d231b; } .aviso.info { background: var(--azul-f); border-color: #bcd4ee; color: #174675; }
.nota-caja { background: var(--ambar-f); border: 1px solid #f0d9a8; border-radius: 8px; padding: .7rem 1rem; margin-bottom: 1rem; color: #6b4406; font-size: .92rem; }
.info-caja { background: var(--azul-f); border: 1px solid #c7dbf1; border-radius: 8px; padding: .7rem 1rem; margin-bottom: 1rem; color: #174675; font-size: .92rem; }

/* Aviso de lo que falta para avanzar */
.falta { background: #fff; border: 1px solid var(--borde); border-left: 5px solid #9fb0c0; border-radius: var(--radio); padding: 1rem 1.2rem; margin-bottom: 1.1rem; box-shadow: var(--sombra); }
.falta.mia { border-color: #f0d9a8; border-left-color: #e0a422; background: #fffaf0; }
.falta > header { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .35rem; } .falta h2 { color: var(--marca); }
.falta li small { display: block; color: var(--tenue); margin-top: .15rem; } .falta .lista-simple { margin: .4rem 0 .6rem; } .falta > p:last-child { margin-bottom: 0; }

/* Formularios */
.campo { display: block; margin-bottom: .9rem; } .campo > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; } .campo small { display: block; margin-top: .2rem; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid #b9c5d1; border-radius: 7px; font: inherit; background: #fff; color: var(--texto); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--acento); outline: 2px solid rgba(8, 126, 139, .25); }
input[type=file] { font: inherit; max-width: 100%; }
.boton { display: inline-block; border: 1px solid transparent; border-radius: 7px; padding: .5rem .95rem; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; line-height: 1.3; }
.boton.primario { background: var(--acento); color: #fff; } .boton.primario:hover { background: var(--acento-2); }
.boton.secundario { background: #fff; color: var(--marca); border-color: #b9c5d1; } .boton.secundario:hover { background: var(--gris-f); }
.boton.peligro { background: #fff; color: var(--rojo); border-color: #e3aaa4; } .boton.peligro:hover { background: var(--rojo-f); }
.boton.whatsapp { background: #128c4b; color: #fff; }
.boton.pequeno { padding: .25rem .6rem; font-size: .8rem; }
button.enlace { background: none; border: 0; color: var(--acento-2); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
form.en-linea { display: inline; }
.opciones { display: flex; gap: .5rem; flex-wrap: wrap; } .opciones label { border: 1px solid #b9c5d1; border-radius: 7px; padding: .35rem .7rem; cursor: pointer; background: #fff; font-size: .9rem; display: flex; gap: .4rem; align-items: center; }
.opciones label:has(input:checked) { border-color: var(--acento); background: #e3f4f5; font-weight: 600; }
.opciones.vertical { flex-direction: column; align-items: stretch; }
.pregunta { padding: .9rem 0; border-bottom: 1px solid var(--borde); } .pregunta:last-of-type { border-bottom: 0; }
.pregunta > b { display: block; margin-bottom: .2rem; } .pregunta .ayuda { font-size: .85rem; color: var(--tenue); margin-bottom: .45rem; } .pregunta .req { color: var(--rojo); }
.pregunta[hidden] { display: none; }
.lista-filas td:has(input[name$="__personas"]) { width: 7.5rem; } .lista-filas td:has(input[name$="__funciones"]), .lista-filas td:has(input[name$="__actividades"]) { width: 48%; }
.pista { display: block; color: var(--tenue); font-size: .8rem; margin: .25rem 0 .35rem; }
.atajos { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .4rem; } .atajos small { width: 100%; color: var(--tenue); font-size: .8rem; }
.atajo { border: 1px dashed #8fb9bf; background: #f1f9fa; color: var(--acento-2); border-radius: 999px; padding: .2rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; text-align: left; }
.atajo:hover { background: #dff1f3; border-style: solid; }
.escala { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; } .escala label { font-size: .78rem; text-align: center; flex-direction: column; padding: .4rem .3rem; } .escala label b { font-size: 1rem; }
.lista-filas td { padding: .2rem .25rem; } .lista-filas th { font-size: .8rem; text-align: left; color: var(--tenue); padding: .2rem .25rem; } .lista-filas { width: 100%; border-collapse: collapse; }

/* Tablas */
.tabla-caja { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--tenue); padding: .5rem .6rem; border-bottom: 2px solid var(--borde); white-space: nowrap; }
td { padding: .55rem .6rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
tbody tr:hover { background: #f8fafc; }
table.doc th, table.doc td { border: 1px solid #c3ccd6; } table.doc th { background: var(--gris-f); text-transform: none; letter-spacing: 0; color: var(--texto); font-size: .82rem; white-space: normal; } table.doc td.firma { height: 2.6rem; min-width: 7rem; }

/* Documento */
.documento { background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 1.4rem 1.6rem; }
.documento h3 { color: var(--marca); margin: 1.2rem 0 .5rem; padding-bottom: .25rem; border-bottom: 1px solid var(--borde); } .documento h3:first-child { margin-top: 0; }
.documento .nota { background: #f7f9fb; border-left: 3px solid var(--acento); padding: .45rem .7rem; font-size: .86rem; color: var(--tenue); }
mark { background: #ffe9a8; padding: 0 .15rem; border-radius: 3px; }
.editor textarea { font-family: inherit; font-size: .9rem; } .editor .tabla-edit { font-family: Consolas, "Courier New", monospace; font-size: .82rem; white-space: pre; overflow-x: auto; }
.editor h3 { margin: 1.2rem 0 .5rem; color: var(--marca); }

/* Fases */
.fases { display: grid; gap: .7rem; }
.fase { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: .9rem 1.1rem; border-left: 5px solid #c5ced8; }
.fase.activa { border-left-color: var(--acento); } .fase.cerrada { border-left-color: var(--ok); } .fase.por_revalidar { border-left-color: #e0a422; }
.fase summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center; } .fase summary::-webkit-details-marker { display: none; }
.fase summary h3 small { font-weight: 400; margin-left: .4rem; }
.linea { display: flex; gap: 4px; margin-bottom: 1.1rem; } .linea a { flex: 1; text-align: center; padding: .5rem .2rem; background: var(--gris-f); border-radius: 6px; font-size: .78rem; text-decoration: none; color: var(--tenue); }
.linea a.cerrada { background: var(--ok-f); color: var(--ok); font-weight: 600; } .linea a.activa { background: var(--acento); color: #fff; font-weight: 700; } .linea a.por_revalidar { background: var(--ambar-f); color: var(--ambar); }
.linea a b { display: block; font-size: 1rem; }
.pasos { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; } .pasos a { padding: .35rem .7rem; border-radius: 999px; background: var(--gris-f); text-decoration: none; color: var(--tenue); font-size: .84rem; }
.pasos a.hecho { background: var(--ok-f); color: var(--ok); } .pasos a.actual { background: var(--marca); color: #fff; font-weight: 600; }
.pestanas { display: flex; gap: .2rem; border-bottom: 2px solid var(--borde); margin-bottom: 1.1rem; flex-wrap: wrap; } .pestanas a { padding: .5rem .9rem; text-decoration: none; color: var(--tenue); font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.pestanas a.activa { color: var(--marca); border-bottom-color: var(--acento); }
.criterios li { margin-bottom: .3rem; }
code.enlace-copiar { display: block; background: var(--gris-f); padding: .5rem .7rem; border-radius: 6px; word-break: break-all; font-size: .82rem; margin: .4rem 0; user-select: all; }
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; align-items: end; margin-bottom: 1rem; } .filtros .campo { margin: 0; }

@media (max-width: 860px) {
  body.con-menu { display: block; }
  .menu { position: fixed; left: -260px; width: 236px; z-index: 20; transition: left .2s; } #menu-ver:checked ~ .menu { left: 0; box-shadow: 0 0 0 100vw rgba(0, 0, 0, .35); }
  .menu-boton { display: block; } .barra-superior { padding: .6rem .8rem; } .usuario a small, .usuario a b { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 1rem .8rem 3rem; } .escala { grid-template-columns: repeat(2, 1fr); } .documento { padding: 1rem; } .linea a span { display: none; }
}
@media print { .menu, .barra-superior, .boton, form { display: none !important; } body.con-menu { display: block; } }
