/* Tablero de monitores (/monitores). Usa los tokens de estilo.css: filetes y no tarjetas, radios de
   2 a 6 px, Geist Mono solo para datos y un solo ámbar por vista (el botón principal). Las marcas de
   cada corrida son formas (anillo, punto, aspa, raya, cuadro), no solo colores. */

.tb-portada { padding: clamp(32px, 5vw, 56px) 0 clamp(24px, 3vw, 32px); }
.tb-portada .cab { gap: 10px; }
.tb-seccion { padding: clamp(24px, 3vw, 40px) 0 var(--seccion); }
.tb { display: grid; gap: 40px; min-height: 40vh; }
/* los hijos de una rejilla no se encogen solos: sin esto, una tabla ancha empuja la página en móvil */
.tb > *, .tb-vista > *, .tb-bloque > *, .tb-ensayo > *, .tb-crear > * { min-width: 0; }
.tb-vista { display: grid; gap: 36px; }
.tb-nota { color: var(--tinta-suave); max-width: 640px; }
.tb-nota.chica { font-size: 14px; color: var(--tinta-tenue); }

/* barra de la sesión: la llave enmascarada y salir */
.tb-sesion { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--linea); font-size: 14px; color: var(--tinta-tenue); }
.tb-sesion .mono { color: var(--tinta-suave); font-size: 13px; }
.tb-sesion nav { display: flex; gap: 4px; flex-wrap: wrap; }
.tb-sesion nav a, .tb-sesion button.tb-salir { font: 500 14px/20px var(--font-sans); color: var(--tinta-suave); text-decoration: none;
  padding: 0 12px; min-height: 40px; display: inline-flex; align-items: center; border-radius: var(--radio-pill);
  background: none; border: 0; cursor: pointer; }
.tb-sesion nav a:hover, .tb-sesion button.tb-salir:hover { color: var(--tinta); background: var(--superficie); }
.tb-sesion nav a[aria-current="page"] { color: var(--tinta); background: var(--superficie); }

/* cabecera de cada vista */
.tb-cab { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; justify-content: space-between; }
.tb-cab h2 { font: 700 clamp(24px, 2.6vw, 30px)/1.15 var(--font-sans); letter-spacing: -0.025em; }
.tb-cab p { color: var(--tinta-suave); margin-top: 6px; max-width: 640px; }
.tb-cab .botones { flex: 0 1 auto; }
.tb h3 { font: 600 18px/1.35 var(--font-sans); letter-spacing: -0.01em; }
.tb-bloque { border-top: 1px solid var(--linea-fuerte); padding-top: 18px; display: grid; gap: 14px; min-width: 0; }
.tb-bloque > header { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; justify-content: space-between; }
.tb-bloque > header p { font-size: 14px; color: var(--tinta-tenue); overflow-wrap: anywhere; min-width: 0; }

/* la llave */
.tb-llave { max-width: 560px; }
.tb-llave input { font-family: var(--font-mono); font-size: 15px; }
.tb-llave .tb-err { margin: 0; }

/* mensajes: “no encontrado” es neutro; “no se pudo” es un error con su código */
.tb-err, .tb-vacio, .tb-ok { padding: 12px 0 12px 16px; border-left: 3px solid var(--error); display: grid; gap: 4px; max-width: 760px; }
.tb-err b { color: var(--error); }
.tb-err code, .tb-vacio code { font-size: 13px; color: var(--tinta-suave); overflow-wrap: anywhere; }
.tb-vacio { border-left-color: var(--linea-fuerte); }
.tb-vacio b { color: var(--tinta); }
.tb-vacio p, .tb-err p { color: var(--tinta-suave); }
.tb-ok { border-left-color: var(--verificado); }
.tb-ok b { color: var(--verificado); }
.tb-cargando { color: var(--tinta-tenue); font-size: 14.5px; }

/* tabla de monitores */
.tb-tabla { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tb-tabla th { text-align: left; font: 500 13px/18px var(--font-sans); color: var(--tinta-tenue); padding: 8px 16px 8px 0; border-bottom: 1px solid var(--linea-fuerte); white-space: nowrap; }
.tb-tabla td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--linea); vertical-align: top; }
.tb-tabla td:last-child, .tb-tabla th:last-child { padding-right: 0; }
.tb-tabla .n { font: 500 14px/20px var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-tabla .der { text-align: right; }
.tb-vigilado a { font-weight: 600; color: var(--tinta); text-decoration: none; }
.tb-vigilado a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tb-vigilado code, .tb-sub code { display: block; font-size: 12.5px; color: var(--tinta-tenue); margin-top: 3px; overflow-wrap: anywhere; }
.tb-sub { display: block; font-size: 13px; color: var(--tinta-tenue); margin-top: 2px; }
.tb-fecha { font: 400 13px/18px var(--font-mono); color: var(--tinta-suave); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-sub.tb-fecha { white-space: nowrap; }
.tb-acciones { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.tb .boton.mini { height: 36px; padding: 0 12px; font-size: 14px; }
@media (max-width: 920px), (pointer: coarse) { .tb .boton.mini { height: 44px; } }
.tb .boton[disabled] { opacity: .55; cursor: not-allowed; }
button.boton { font-family: var(--font-sans); }

/* el estado y el resultado: una marca con forma, más el texto */
.tb-res { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tb-res + .tb-sub { white-space: normal; }
.tb-marca { display: inline-block; vertical-align: -1px; width: 10px; height: 10px; flex: none; overflow: visible; }
.tb-estado { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.tb-estado.pausado { color: var(--tinta-suave); }

/* sparkline de avisos: 30 días, una barra por día, línea base en todos */
.tb-chispa { display: flex; align-items: end; gap: 10px; }
.tb-chispa svg { width: 92px; height: 24px; flex: none; }
.tb-chispa .n { min-width: 2ch; text-align: right; }

/* detalle: los datos del monitor en filas con filete */
.tb-ficha { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 32px; margin: 0; }
.tb-ficha > div { border-top: 1px solid var(--linea); padding: 12px 0; min-width: 0; }
.tb-ficha dt { font: 500 13px/18px var(--font-sans); color: var(--tinta-tenue); }
.tb-ficha dd { margin: 4px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.tb-ficha dd .mono { font-size: 13.5px; }
.tb-ficha dd small { display: block; color: var(--tinta-tenue); font-size: 13px; margin-top: 2px; }
.tb-confirmar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 0 12px 16px; border-left: 3px solid var(--error); }
.tb-confirmar p { color: var(--tinta); font-weight: 500; }

/* línea de tiempo de corridas */
.tb-linea svg { width: 100%; height: 76px; }
.tb-leyenda { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--tinta-suave); list-style: none; padding: 0; margin: 0; }
.tb-leyenda li { display: inline-flex; align-items: center; gap: 7px; }
.tb-mas { justify-self: start; }

/* filas de un aviso, tal cual (rt/1): Geist Mono, sin recortar */
.tb-filas { border-left: 3px solid var(--linea-fuerte); padding: 4px 0 4px 16px; display: grid; gap: 12px; min-width: 0; }
.tb-filas .tb-tabla td { font: 400 12.5px/18px var(--font-mono); padding: 8px 14px 8px 0; min-width: 12ch; max-width: 44ch; overflow-wrap: break-word; }
.tb-filas .tb-tabla th { font: 500 12px/16px var(--font-mono); color: var(--tinta-tenue); }
.tb-filas .tb-tabla td a { color: var(--verificado); word-break: break-all; }
.tb-filas .fuente-dato { overflow-wrap: anywhere; }
.tb .desliza { max-width: 100%; }
.tb-cambio del { color: var(--tinta-tenue); }
.tb-cambio ins { text-decoration: none; color: var(--tinta); font-weight: 600; }

/* crear: buscador y herramientas por familia */
.tb-buscar { display: grid; gap: 6px; max-width: 560px; }
.tb-buscar label { font-weight: 600; font-size: 15px; }
.tb-buscar input { height: 48px; border-radius: var(--radio-md); border: 0; box-shadow: inset 0 0 0 1px var(--linea-fuerte); background: #fff;
  padding: 0 14px; font: 400 16px/1 var(--font-sans); color: var(--tinta); }
.tb-buscar input:focus { outline: 2px solid var(--foco); outline-offset: 2px; }
.tb-familia { display: grid; gap: 0; }
.tb-familia h3 { padding-bottom: 8px; border-bottom: 1px solid var(--linea-fuerte); }
.tb-familia h3 small { font: 400 13px/18px var(--font-mono); color: var(--tinta-tenue); margin-left: 8px; }
.tb-herr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; padding: 14px 8px; margin: 0 -8px; border-bottom: 1px solid var(--linea);
  text-decoration: none; color: inherit; border-radius: var(--radio-sm); align-items: baseline; }
.tb-herr:hover { background: var(--superficie); }
.tb-herr b { font-weight: 500; }
.tb-herr code { grid-column: 1; font-size: 12.5px; color: var(--tinta-tenue); overflow-wrap: anywhere; }
.tb-herr .tb-cr { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-size: 13px; color: var(--tinta-suave); }
.tb-herr .tb-cr span { display: block; font: 500 13.5px/20px var(--font-mono); color: var(--tinta); }
@media (max-width: 560px) { .tb-herr { grid-template-columns: minmax(0, 1fr); } .tb-herr .tb-cr { grid-column: 1; grid-row: auto; text-align: left; } }

/* crear: el formulario */
.tb-crear { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 56px; align-items: start; }
@media (max-width: 960px) { .tb-crear { grid-template-columns: minmax(0, 1fr); } }
.tb-form { display: grid; gap: 18px; max-width: 600px; }
.tb-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; min-width: 0; }
.tb-form legend { font: 600 15px/1.35 var(--font-sans); padding: 0 0 4px; }
.tb-form legend small { display: block; font-weight: 400; color: var(--tinta-tenue); font-size: 13.5px; }
.tb-campo { display: grid; gap: 6px; }
.tb-campo > label, .tb-campo > .et { font-weight: 600; font-size: 15px; }
.tb-campo .obl { font-weight: 400; color: var(--tinta-tenue); font-size: 13px; margin-left: 6px; }
.tb-campo .ayuda { font-size: 13.5px; color: var(--tinta-tenue); }
.tb-campo code.nom { font-size: 12px; color: var(--tinta-tenue); font-weight: 400; margin-left: 6px; }
.tb-campo input, .tb-campo select { font: 400 16px/1.4 var(--font-sans); color: var(--tinta); background: #fff; border: 0; border-radius: var(--radio-md);
  box-shadow: inset 0 0 0 1px var(--linea-fuerte); padding: 10px 12px; min-height: 44px; width: 100%; }
.tb-campo input:focus, .tb-campo select:focus { outline: 2px solid var(--foco); outline-offset: 2px; }
.tb-campo input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--error); }
.tb-campo .tb-msg { font-size: 13.5px; color: var(--error); font-weight: 500; }
.tb-campo .casilla { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 400; }
.tb-campo .casilla input { width: 22px; height: 22px; min-height: 0; padding: 0; box-shadow: none; accent-color: var(--bosque-800); }
.tb-costo { border-top: 1px solid var(--linea); padding-top: 14px; display: grid; gap: 4px; font-size: 14.5px; color: var(--tinta-suave); }
.tb-costo b { color: var(--tinta); font-weight: 600; }
.tb-costo .n { font: 600 14.5px/20px var(--font-mono); color: var(--tinta); }
.tb-dias { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tb-dias label { font-size: 14.5px; color: var(--tinta-suave); }
.tb-dias select { font: 400 15px/1 var(--font-sans); color: var(--tinta); background: #fff; border: 0; border-radius: var(--radio-md);
  box-shadow: inset 0 0 0 1px var(--linea-fuerte); padding: 0 10px; height: 44px; }
.tb-secreto { display: grid; gap: 10px; padding: 14px 0 14px 16px; border-left: 3px solid var(--verificado); }
.tb-secreto pre { font: 400 13px/20px var(--font-mono); background: var(--superficie); padding: 10px 12px; border-radius: var(--radio-md); overflow-x: auto; }

/* el ensayo con los días pasados */
.tb-ensayo { display: grid; gap: 16px; min-width: 0; }
.tb-ensayo .tb-cifra { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.tb-ensayo .tb-cifra strong { font: 700 clamp(36px, 4vw, 48px)/1 var(--font-sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tb-ensayo .tb-cifra span { color: var(--tinta-suave); font-size: 15px; }
.tb-barras svg { width: 100%; height: 160px; overflow: visible; }
.tb-barras text { font: 400 11px var(--font-mono); fill: var(--tinta-tenue); }
.tb-limites { font-size: 14px; color: var(--tinta-suave); padding-left: 16px; border-left: 3px solid var(--linea-fuerte); }
.tb-ensayo details summary { cursor: pointer; font-size: 14px; color: var(--verificado); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.tb-ensayo details .tb-tabla { max-width: 360px; }
.tb-espera { color: var(--tinta-tenue); font-size: 14.5px; padding: 24px 0; border-top: 1px solid var(--linea); }

/* móvil: la tabla de monitores pasa a una ficha por monitor, con su rótulo en cada dato */
@media (max-width: 760px) {
  .tb-lista thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tb-lista, .tb-lista tbody { display: block; }
  .tb-lista tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; padding: 16px 0; border-bottom: 1px solid var(--linea); }
  .tb-lista td { display: block; padding: 0; border: 0; min-width: 0; }
  .tb-lista td.tb-vigilado, .tb-lista td.tb-acc { grid-column: 1 / -1; }
  .tb-lista td[data-et]::before { content: attr(data-et); display: block; font: 400 12.5px/18px var(--font-sans); color: var(--tinta-tenue); margin-bottom: 2px; }
  .tb-lista .tb-acciones { justify-content: flex-start; }
  .tb-corridas th:nth-child(4), .tb-corridas td:nth-child(4) { display: none; }
}
.tb-panel-aviso { display: grid; gap: 10px; margin-top: 8px; min-width: 0; }
.tb-panel-t { font: 600 15px/1.35 var(--font-sans); }
/* las filas de un aviso se deslizan de lado: cada celda corta a 40 caracteres, no a lo que quepa */
.tb-filas .tb-tabla { width: max-content; min-width: 100%; }
.tb-filas .tb-tabla td { max-width: 40ch; }
@media (max-width: 760px) {
  .tb-avisos th:nth-child(4), .tb-avisos td:nth-child(4), .tb-avisos th:nth-child(6), .tb-avisos td:nth-child(6) { display: none; }
}
