/* ==========================================================================================================
   TABLEROS Y TABLAS (19-nov-2026, el usuario: "dashboards impecables, tablas impecables; mejorar cómo vemos y
   analizamos la información — pero deben mostrar LA MISMA información y poder consultar lo mismo").
   Por eso aquí SOLO hay acomodo y presentación (CSS): ningún dato, filtro, clic ni cálculo cambia.
   Solo aplica con html.tema (_cabeza.html). Va después de tema.css y lateral.css.
   ========================================================================================================== */

/* ---------------------------------------------------------------- COSTOS (#tsy, costos_tablero.js) */
@media screen {
  /* barra de vistas (Diario, Semanal, Mensual...) como control segmentado, con las acciones al final */
  html.tema #tsyContenido > .bar:first-of-type { gap: 0.35rem; padding: 0.4rem !important; border-radius: 16px !important; align-items: center; }
  html.tema #tsyContenido > .bar:first-of-type > button { border-radius: 10px !important; padding: 0.45rem 0.85rem !important; font-weight: 500 !important; }
  html.tema #tsyContenido > .bar:first-of-type > select { border-radius: 10px !important; }
  html.tema #tsy .bar { gap: 0.5rem; margin-bottom: 0.9rem; }
  html.tema #tsy .sub { margin-bottom: 0.8rem; color: #8A8FA3; }
  html.tema #tsy .sub::before { background: #1F8A5B; box-shadow: 0 0 0 3px rgb(31 138 91 / 0.15); }
  /* título del período */
  html.tema #tsy #wl, html.tema #tsy .dia-titulo { font-size: 1.15rem !important; font-weight: 500 !important; margin: 0.25rem 0 0.9rem; }
  /* indicadores: rejilla pareja (4 por fila en PC), cifra grande y etiqueta arriba */
  html.tema #tsy .grid { gap: 12px; }
  html.tema #tsy .k { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  @media (min-width: 1200px) { html.tema #tsy .k { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  html.tema #tsy .k > .card { padding: 1rem 1.15rem !important; min-height: 104px; display: flex; flex-direction: column; justify-content: flex-start; gap: 0.2rem; }
  html.tema #tsy .k .kl:first-child { color: #5B6170; }
  html.tema #tsy .k .kv { font-size: 1.6rem !important; line-height: 1.15; margin: 0.15rem 0 0.1rem; }
  html.tema #tsy .k .kl:last-child:not(:first-child) { font-size: 0.78rem; color: #8A8FA3; }
  html.tema #tsy .k > .card:first-child .kl:last-child { color: rgb(255 255 255 / 0.7) !important; }
  /* gráficas y tablas en tarjetas del mismo alto por fila */
  html.tema #tsy .c2, html.tema #tsy .c3 { margin: 12px 0; align-items: stretch; }
  html.tema #tsy .card { padding: 1.1rem 1.25rem !important; border-radius: 16px !important; }
  html.tema #tsy .card > h2 { font-size: 0.98rem; font-weight: 600; margin-bottom: 0.75rem; display: block; }
  html.tema #tsy .card > h2::before { display: none; }
  html.tema #tsy .card > h2 .kl { display: block; font-size: 0.76rem; font-weight: 400; color: #8A8FA3; margin-top: 0.15rem; text-transform: none; letter-spacing: 0; }
  html.tema #tsy .ch { height: 300px; }
  /* las tablas grandes (placas, remolques, sistemas, trabajos) a todo el ancho: se ven TODAS sus columnas sin desplazar de lado */
  html.tema #tsy .c3 { grid-template-columns: 1fr; }
  @media (min-width: 1700px) { html.tema #tsy .c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  html.tema #tsy .c3 .sc { max-height: 440px; }
  /* tablas: sin barra de desplazamiento gruesa; las OT de cada placa se acomodan en varias líneas */
  html.tema #tsy .sc { scrollbar-width: thin; border-radius: 10px; }
  html.tema #tsy table { font-size: 12.5px; }
  html.tema #tsy th, html.tema #tsy td { padding: 8px 10px; }
  html.tema #tsy th { background: rgb(244 245 250 / 0.95) !important; }
  html.tema #tsy td:last-child:has(.pill) { white-space: normal; text-align: left; }
  html.tema #tsy .pill { background: #fff !important; border: 1px solid rgb(26 28 51 / 0.1) !important; font-weight: 500; font-size: 11.5px; padding: 1px 8px; }
  html.tema #tsy a { color: #040677; font-weight: 600; }
  html.tema #tsy .linea { font-weight: 600; font-size: 10.5px; letter-spacing: 0.02em; }
  html.tema #tsy .note { color: #8A8FA3; }
}

/* ---------------------------------------------------------------- PORTADAS DE LAS APPS (app_portada.html) */
@media screen {
  html.tema .app-portada-hora { color: #8A8FA3 !important; background: rgb(255 255 255 / 0.6) !important; border: 1px solid rgb(26 28 51 / 0.08); border-radius: 999px; padding: 0.3rem 0.8rem; }
  html.tema header.bg-tinta [class*="app-portada"] h1, html.tema header.bg-tinta [class*="app-portada"] p { color: inherit; }
}