:root {
  color-scheme: light;
  --marca: #006067;
  --turquesa: #00a5b5;
  --noche: #0e1b36;
  --texto: #0c3856;
  --suave: #666;
  --fondo: #f9f9f9;
  --papel: #fff;
  --tinte: #eaf4f4;
  --enlace: #006067;
  --linea: #d8d8d8;
  --campo: #757575;
  --peligro: #9f292e;
  font: 1rem/1.5 "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--texto); background: var(--fondo); overflow-wrap: anywhere; }
.cabecera { background: var(--noche); color: white; border-bottom: 4px solid; border-image: linear-gradient(90deg, var(--marca), var(--turquesa)) 1; }
.barra, main, footer { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.barra, .marca, .enlaces { display: flex; gap: 1rem; align-items: center; }
.barra { justify-content: space-between; padding-block: .85rem; }
.marca { color: inherit; text-decoration: none; font-weight: 700; white-space: nowrap; }
.marca img { width: 8rem; height: auto; display: block; }
.marca span { border-inline-start: 1px solid #65758b; padding-inline-start: 1rem; }
main { padding-block: clamp(1.25rem, 4vw, 3rem); }
footer { padding: 1rem 0 2rem; border-top: 1px solid var(--linea); color: var(--suave); font-size: .875rem; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .85rem; }
h1 { font-size: clamp(1.75rem, 4vw, 2.55rem); letter-spacing: -.035em; }
h2 { font-size: 1.25rem; }
main > h2, main > section { margin-top: 1.5rem; }
a { color: var(--enlace); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .15em; }
button, input, textarea, select, summary { font: inherit; }
button, summary, .enlaces a, .opciones a, nav a { min-height: 44px; padding: .6rem .95rem; }
button, .secundario, nav a { border: 1px solid transparent; border-radius: .45rem; font-weight: 650; }
button { background: var(--marca); color: white; cursor: pointer; }
button:hover { background: #00484e; }
button:disabled { background: var(--linea); color: var(--texto); cursor: default; }
summary { cursor: pointer; font-weight: 650; }
summary:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--enlace); outline-offset: 3px; }
.cabecera :focus-visible { outline-color: #80fbff; }
.cabecera a, .cabecera summary { color: white; }
.enlaces { gap: .25rem; }
.enlaces a { display: block; text-decoration: none; }
.enlaces [aria-current], .enlaces .actual { text-decoration: underline; text-decoration-color: #80fbff; text-underline-offset: .4rem; }
.enlaces a:hover, .cabecera summary:hover { background: #233857; border-radius: .45rem; }
.secundario { background: transparent; border-color: #a2a2a2; color: inherit; }
.secundario:hover { background: #233857; }
.submenu { position: relative; }
.submenu > div, .movil > .enlaces { position: absolute; right: 0; z-index: 2; min-width: 14rem; padding: .5rem; border: 1px solid #65758b; border-radius: .5rem; background: var(--noche); }
.movil, .etiqueta-movil { display: none; }
.acceso .barra { justify-content: center; }
.acceso main, .panel, .ficha section, .averia section, #historial-investigaciones, .asignacion {
  padding: clamp(1rem, 2.5vw, 1.65rem); border: 1px solid var(--linea); border-radius: .75rem; background: var(--papel);
}
.acceso main { max-width: 28rem; margin-block: clamp(2rem, 7vw, 6rem); }
.acceso h1 { font-size: 1.8rem; }
.acceso footer { text-align: center; }
form, label { display: grid; gap: .4rem; }
form { gap: 1rem; }
label { font-weight: 600; }
input, textarea, select { width: 100%; min-width: 0; min-height: 44px; padding: .6rem .8rem; border: 1px solid var(--campo); border-radius: .4rem; color: var(--texto); background: var(--papel); }
textarea { resize: vertical; }
.texto-intervencion { white-space: pre-wrap; }
input:user-invalid { border: 2px solid var(--peligro); }
.acceso form, .alta, .riesgo form { margin-block: 1.25rem; }
.qr { max-width: 16rem; background: white; }
.qr svg { display: block; width: 100%; height: auto; }
code { overflow-wrap: anywhere; }
#clave, #activacion { display: block; padding: 1rem; background: var(--tinte); border-radius: .4rem; }
.opciones { list-style: none; padding: 0; display: grid; gap: .75rem; }
.opciones { grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.opciones a { display: block; background: var(--papel); border: 1px solid var(--linea); border-inline-start: .25rem solid var(--marca); border-radius: .4rem; font-weight: 650; }
.busqueda, .filtros { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin: 1.5rem 0; }
.busqueda label { flex: 1 1 17rem; }
.filtros label { flex: 1 1 9rem; min-width: 0; }
main nav { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-block: 1rem; }
main nav a, .inventario + a { display: inline-flex; align-items: center; color: var(--enlace); border: 1px solid currentColor; border-radius: .45rem; min-height: 44px; padding: .5rem .85rem; }
.inventario { overflow: auto; background: var(--papel); border: 1px solid var(--linea); border-radius: .6rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem; text-align: start; border-bottom: 1px solid var(--linea); }
th { font-size: .875rem; background: var(--tinte); }
.equipos tbody tr { position: relative; }
.equipos td:first-child a::after { content: ""; position: absolute; inset: 0; }
.equipos td:first-child a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }
.equipos tr:focus-within, .equipos tbody tr:hover { background: var(--tinte); }
.icono-equipo { width: 2rem; height: 2rem; object-fit: contain; vertical-align: middle; background: white; border-radius: .35rem; }
.indicador { display: inline-block; border-inline-start: .35rem solid #737d85; background: var(--tinte); padding: .3rem .7rem; border-radius: .35rem; font-weight: 700; }
.indicador.verde { border-color: #278547; }
.indicador.amarillo { border-color: #ad7700; }
.indicador.rojo { border-color: #c83f3f; }
.indicador small, .indicador time { display: block; font-size: .8rem; font-weight: 400; }
.resumen-equipo { margin-block: 1rem; display: flex; align-items: center; gap: .6rem; }
.ficha { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.ficha form, .averia form { margin-top: .75rem; }
dt { color: var(--suave); font-size: .9rem; }
dd { margin: 0 0 .6rem; }
.averia { max-width: 54rem; }
.averia section { margin-block: 1rem; }
.averia section:target { outline: 3px solid var(--enlace); }
.averia a[href^="#"] { font-weight: 700; }
.aviso, .conclusion { padding: 1rem; border-inline-start: .3rem solid var(--marca); background: var(--tinte); }
.crear-cuenta { margin: 1rem 0; }
.crear-cuenta > summary { width: fit-content; background: var(--marca); color: white; border-radius: .45rem; }
.directorio { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(17rem, 1fr); gap: 1.5rem; align-items: start; }
.lista-personas, .detalle-persona { background: var(--papel); border: 1px solid var(--linea); border-radius: .75rem; }
.lista-personas { overflow: hidden; }
.lista-personas h2, .lista-personas > p { margin: 0; padding: 1rem; }
.lista-personas h2 span, .personas small { color: var(--suave); }
.personas { table-layout: fixed; }
.personas th:first-child { width: 50%; }
.personas td:first-child { padding: 0; }
.personas td a { display: flex; gap: .75rem; align-items: center; min-height: 3.75rem; padding: .65rem .75rem; text-decoration: none; }
.personas a:hover strong, .personas a:focus-visible strong { text-decoration: underline; }
.personas a:focus-visible { outline-offset: -3px; }
.personas a[aria-current] { box-shadow: inset 4px 0 var(--enlace); background: var(--tinte); }
.personas small { display: block; overflow-wrap: anywhere; }
.avatar { display: inline-grid; flex: 0 0 2.35rem; place-items: center; height: 2.35rem; border-radius: 50%; background: var(--marca); color: white; font-weight: 700; }
.personas tr:nth-child(even) .avatar { background: #0c3856; }
.estado-cuenta { display: inline-block; border-radius: 1rem; padding: .12rem .55rem; font-size: .85rem; background: var(--fondo); color: var(--suave); border: 1px solid var(--linea); }
.estado-cuenta.activa { color: var(--enlace); background: var(--tinte); }
.detalle-persona { scroll-margin: 1rem; }
.detalle-persona header { display: flex; gap: .8rem; align-items: center; }
.detalle-persona header h2 { margin: 0; }
.detalle-persona h3 { font-size: 1rem; margin-bottom: .35rem; }
.perfil-cuenta, .acciones-cuenta, .baja-cuenta { padding-top: 1rem; border-top: 1px solid var(--linea); }
.perfil-cuenta { margin-bottom: 1rem; }
.perfil-cuenta dd { overflow-wrap: anywhere; }
.perfil-cuenta summary { padding-inline: 0; color: var(--enlace); }
.detalle-persona a { display: flex; align-items: center; min-height: 44px; }
.acciones-cuenta summary { padding-inline: 0; }
.detalle-persona a, .acciones-cuenta summary, .baja-cuenta h3, .riesgo p { color: var(--peligro); }
.baja-cuenta { margin-top: 1rem; }
.acciones-cuenta button, .riesgo button { background: #9f292e; }
.acciones-cuenta button:hover, .riesgo button:hover { background: #7e1821; }
.riesgo, .alta, .invitacion { max-width: 38rem; }
.riesgo { border-inline-start: .3rem solid var(--peligro); }
.asignacion { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.asignacion button[value="retirar"] { background: var(--papel); color: var(--peligro); border-color: currentColor; }
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --texto: #f3f7fa; --suave: #d8d8d8; --fondo: #0e1b36; --papel: #172a45; --tinte: #213b4c; --linea: #516378; --campo: #a2a2a2; --enlace: #80fbff; --peligro: #ffb2b2; }
}
@media (max-width: 42rem) {
  .directorio { grid-template-columns: minmax(0, 1fr); }
  .personas th, .personas td { padding-inline: .35rem; }
  .personas td a { gap: .4rem; }
  .escritorio { display: none; }
  .movil { display: block; position: relative; }
  .movil > .enlaces { display: grid; max-width: calc(100vw - 2rem); }
  .submenu > div { position: static; padding-inline-start: 1rem; min-width: 0; border: 0; }
  .equipos { border: 0; background: transparent; }
  .barra, .marca { gap: .5rem; }
  .marca span { padding-inline-start: .55rem; }
  .marca img { width: 6.75rem; }
  .equipos table, .equipos tbody { display: block; }
  .equipos thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .equipos tbody tr { display: grid; background: var(--papel); margin-bottom: .75rem; border: 1px solid var(--linea); border-radius: .6rem; padding: .65rem 1rem; }
  .equipos td { display: block; padding: .35rem 0; border: 0; }
  .equipos td:first-child { border-bottom: 1px solid var(--linea); margin-bottom: .3rem; }
  .etiqueta-movil { display: inline-block; min-width: 4rem; color: var(--suave); font-size: .875rem; }
  .equipos .indicador { vertical-align: top; }
  .inventario:not(.equipos) table { min-width: 52rem; }
}
