@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("fonts/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("fonts/montserrat-latin-800-normal.woff2") format("woff2"); }

:root {
  --tinta: #131C66;
  --tinta-suave: #5A6094;
  --fondo: #F3F2F2;
  --blanco: #FFFFFF;
  --acento: #2A71BA;
  --destacado: #1F8395;
  --menta: #53F9DF;
  --noche: #050F32;
  --aviso: #C2410C;
  --error: #B42318;
  --ok: #157A4A;
  --linea: rgba(19, 28, 102, 0.12);
  --sombra: 0 18px 40px -26px rgba(15, 28, 74, 0.45);
  --radio: 14px;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 500; font-size: 15px; line-height: 1.45; color: var(--tinta); background: var(--fondo); -webkit-font-smoothing: antialiased; }
a { color: var(--acento); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
small, .suave { color: var(--tinta-suave); }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(42, 113, 186, 0.45); outline-offset: 2px; }

.barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 0 28px; height: 60px; background: var(--noche); color: #fff; }
.barra .marca { display: flex; align-items: center; gap: 10px; font-weight: 800; color: #fff; font-size: 16px; }
.barra .marca i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--tinta); }
.barra .marca i::after { content: ""; border-left: 11px solid var(--menta); border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }
.barra nav { display: flex; gap: 4px; flex: 1; }
.barra nav a { color: rgba(255, 255, 255, 0.75); padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.barra nav a.activo, .barra nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.1); text-decoration: none; }
.barra .usuario { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 14px; }
.barra .usuario button { background: transparent; border: 1px solid rgba(255, 255, 255, 0.25); color: #fff; padding: 6px 12px; border-radius: 8px; cursor: pointer; }

main { max-width: 1320px; margin: 0 auto; padding: 28px; }
.fila { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.entre { justify-content: space-between; }
.pila { display: flex; flex-direction: column; gap: 12px; }
.rejilla { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.espacio { flex: 1; }
.oculto { display: none !important; }

.tarjeta { background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra); padding: 20px; }
.tarjeta + .tarjeta { margin-top: 16px; }
.seccion { margin-top: 24px; }
.seccion > h2 { margin-bottom: 12px; }

.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--linea); background: var(--blanco); color: var(--tinta); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.boton:hover { border-color: rgba(19, 28, 102, 0.3); text-decoration: none; }
.boton:disabled { opacity: 0.5; cursor: not-allowed; }
.boton.principal { background: var(--acento); border-color: var(--acento); color: #fff; }
.boton.principal:hover { background: #235f9c; }
.boton.ok { background: var(--destacado); border-color: var(--destacado); color: #fff; }
.boton.peligro { color: var(--error); }
.boton.peligro.lleno { background: var(--error); border-color: var(--error); color: #fff; }
.boton.peque { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.boton.texto { border: 0; background: transparent; padding: 4px 6px; color: var(--acento); }

input[type=text], input[type=password], input[type=number], select, textarea { width: 100%; padding: 9px 12px; border: 1px solid rgba(19, 28, 102, 0.2); border-radius: 10px; background: #fff; }
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.campo { margin-bottom: 14px; }
.casilla { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.casilla input { width: auto; }

.etiqueta { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #E8EAF3; color: var(--tinta); white-space: nowrap; }
.etiqueta::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.e-nuevo, .e-listo { background: #E8EAF3; color: var(--tinta-suave); }
.e-en_cola { background: #E6EEF8; color: var(--acento); }
.e-trabajando, .e-en_curso, .e-cancelando { background: #E3F1FB; color: var(--acento); }
.e-trabajando::before, .e-en_curso::before { animation: latir 1.2s ease-in-out infinite; }
.e-parada { background: #FFF1DB; color: #9A5B00; }
.e-terminado, .e-hecho { background: #DCF3E8; color: var(--ok); }
.e-error { background: #FDE7E5; color: var(--error); }
.e-cancelado, .e-pendiente { background: #EEEEF2; color: var(--tinta-suave); }
@keyframes latir { 50% { opacity: 0.2; } }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tinta-suave); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--linea); }
td { padding: 10px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
tr.clic { cursor: pointer; }
tr.clic:hover td { background: #F7F8FC; }

.pc { display: flex; gap: 12px; align-items: center; }
.pc .luz { width: 12px; height: 12px; border-radius: 50%; background: #C4C7D4; flex: none; }
.pc .luz.vivo { background: #22C55E; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); }
.medidor { height: 8px; background: #E8EAF3; border-radius: 4px; overflow: hidden; }
.medidor > i { display: block; height: 100%; background: var(--acento); }
.medidor.alto > i { background: var(--aviso); }

.cabecera { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.cabecera .titulo { display: flex; flex-direction: column; gap: 6px; }
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--linea); margin: 0 0 20px; overflow-x: auto; }
.pestanas a { padding: 10px 16px; font-weight: 700; color: var(--tinta-suave); border-bottom: 3px solid transparent; white-space: nowrap; }
.pestanas a.activo { color: var(--tinta); border-color: var(--acento); }
.pestanas a:hover { text-decoration: none; color: var(--tinta); }
.pestanas a b { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--aviso); color: #fff; font-size: 12px; text-align: center; }

.revision { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .revision { grid-template-columns: 1fr; } }
.resumen { white-space: pre-wrap; }
.lista-revisar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.lista-revisar .boton.activo { border-color: var(--acento); box-shadow: inset 0 0 0 1px var(--acento); }
.aviso-caja { padding: 12px 14px; border-radius: 10px; background: #FFF6E5; color: #7A4A00; font-weight: 600; }
.info-caja { padding: 12px 14px; border-radius: 10px; background: #EEF3FB; color: var(--tinta); }
.error-caja { padding: 12px 14px; border-radius: 10px; background: #FDECEA; color: var(--error); font-weight: 600; white-space: pre-wrap; }

.visor { background: var(--noche); border-radius: var(--radio); overflow: hidden; color: #fff; }
.visor .lienzo { position: relative; display: grid; place-items: center; min-height: 240px; background: #000; }
.visor video, .visor img { display: block; max-width: 100%; max-height: 70vh; transition: transform 0.2s; }
.visor iframe { display: block; width: 100%; height: 70vh; border: 0; background: #0B0F1E; }
.visor .controles { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: #0B1440; }
.visor .controles .boton { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.visor .controles .boton.principal { background: var(--acento); border-color: var(--acento); }
.visor .controles .ruta { font-family: var(--mono); font-size: 12px; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visor pre.texto { margin: 0; padding: 18px; max-height: 70vh; overflow: auto; background: #fff; color: var(--tinta); white-space: pre-wrap; word-break: break-word; width: 100%; }
.visor .vacio { padding: 60px 20px; text-align: center; opacity: 0.7; }
.visor .nota-rapida { display: flex; gap: 8px; padding: 10px 12px; background: #0B1440; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.visor .nota-rapida input { background: #fff; }

.notas { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.nota { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #F6F7FB; }
.nota .tiempo { font-family: var(--mono); font-weight: 700; color: var(--acento); cursor: pointer; flex: none; }
.nota .cuerpo { flex: 1; min-width: 0; }
.nota .cuerpo small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.subida { border: 2px dashed rgba(19, 28, 102, 0.25); border-radius: var(--radio); padding: 22px; text-align: center; background: #FAFAFD; transition: background 0.15s, border-color 0.15s; }
.subida.encima { background: #EAF2FB; border-color: var(--acento); }
.cola { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cola .item { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 10px; background: #F6F7FB; font-size: 13px; }
.cola .item .nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }

.arbol { font-size: 14px; }
.arbol .carpeta > .cab { display: flex; align-items: center; gap: 8px; padding: 7px 8px; font-weight: 700; cursor: pointer; border-radius: 8px; }
.arbol .carpeta > .cab:hover { background: #F3F4F9; }
.arbol .carpeta > .cab .flecha { width: 14px; transition: transform 0.15s; }
.arbol .carpeta.abierta > .cab .flecha { transform: rotate(90deg); }
.arbol .hijos { margin-left: 18px; border-left: 1px solid var(--linea); padding-left: 8px; }
.arbol .carpeta:not(.abierta) > .hijos { display: none; }
.arbol .fichero { display: grid; grid-template-columns: 22px minmax(0, 1fr) 90px 60px 170px auto; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 8px; }
.arbol .fichero:hover { background: #F7F8FC; }
.arbol .fichero .nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.arbol .fichero .nombre:hover { color: var(--acento); }
.arbol .fichero .acciones { display: flex; gap: 2px; opacity: 0; }
.arbol .fichero:hover .acciones { opacity: 1; }
@media (max-width: 900px) { .arbol .fichero { grid-template-columns: 22px minmax(0, 1fr) 80px auto; } .arbol .fichero .ver, .arbol .fichero .quien { display: none; } .arbol .fichero .acciones { opacity: 1; } }

.salidas { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.salida { background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; display: flex; flex-direction: column; }
.salida .vista { aspect-ratio: 16 / 9; background: #0B0F1E; display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.salida .vista video, .salida .vista img { width: 100%; height: 100%; object-fit: contain; }
.salida .vista .ext { color: #fff; font-weight: 800; font-size: 28px; opacity: 0.7; text-transform: uppercase; }
.salida .pie { padding: 12px 14px; display: flex; gap: 8px; align-items: center; }
.salida .pie .nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 14px; }

.log { margin: 0; padding: 14px; background: #0B0F1E; color: #D7DBEA; border-radius: 10px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 520px; overflow: auto; }
.log.corto { max-height: 260px; }
.mensaje { margin: 0; padding: 14px; background: #F6F7FB; border-radius: 10px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; max-height: 300px; overflow: auto; }

.velo { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(5, 15, 50, 0.55); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--blanco); border-radius: 18px; box-shadow: 0 40px 90px -30px rgba(5, 15, 50, 0.6); padding: 24px; }
.modal.ancho { width: min(980px, 100%); }
.modal h2 { margin-bottom: 16px; }
.modal .pie { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.editor { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--blanco); }
.editor .cab { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--linea); }
.editor .cab .ruta { font-family: var(--mono); font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor textarea { flex: 1; border: 0; border-radius: 0; padding: 18px 22px; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; resize: none; tab-size: 2; outline: none; }
.editor .estado { font-size: 13px; color: var(--tinta-suave); }

.entrada { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(55% 75% at 82% 45%, #CDD8F5 0%, transparent 70%), radial-gradient(35% 45% at 100% 100%, #D6F2F7 0%, transparent 75%), var(--fondo); }
.entrada .tarjeta { width: min(400px, 100%); padding: 32px; }
.entrada h1 { margin-bottom: 4px; }

#avisos { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.aviso { padding: 12px 16px; border-radius: 12px; background: var(--noche); color: #fff; box-shadow: var(--sombra); font-weight: 600; max-width: 420px; animation: entra 0.2s ease-out; }
.aviso.mal { background: var(--error); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }

.vacio-grande { padding: 50px 20px; text-align: center; color: var(--tinta-suave); }
.pasos { counter-reset: paso; display: flex; flex-direction: column; gap: 12px; }
.paso { display: flex; gap: 14px; align-items: flex-start; }
.paso::before { counter-increment: paso; content: counter(paso); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tinta); color: #fff; font-weight: 800; font-size: 13px; }
.paso.hecho::before { content: "✓"; background: var(--destacado); }

/* Visor: el selector de velocidad no ocupa toda la fila */
.visor .controles select { width: auto; }

/* Móvil: la barra cabe en 390 px y el contenido usa 16 px de margen */
@media (max-width: 700px) {
  .barra { gap: 10px; padding: 0 16px; }
  .barra .marca { font-size: 0; gap: 0; }
  .barra nav a { padding: 8px 10px; }
  .barra .usuario { gap: 6px; }
  .barra .usuario span { display: none; }
  .barra .usuario button { padding: 6px 10px; }
  main { padding: 20px 16px; }
  .seccion.tarjeta { overflow-x: auto; }
}
