/* Panel de administración: menú lateral, indicadores, tablas y diálogos.
   Escritorio: menú fijo a la izquierda. Tableta y celular: barra superior y menú que se abre desde la izquierda. */
body.panel { font-size: 14.5px; }

/* ---------- estructura ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.barra, .velo { display: none; }
.lateral {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: var(--superficie); border-right: 1px solid var(--linea); padding: 22px 14px 14px; overflow-y: auto;
}
.lateral .marca { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; }
.lateral .marca b { display: block; font-size: 14.5px; font-weight: 750; line-height: 1.2; letter-spacing: .005em; }
.lateral .marca small { display: block; color: var(--gris); font-size: 12px; margin-top: 1px; }
nav.menu { display: flex; flex-direction: column; gap: 2px; }
nav.menu button {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 10px; padding: 9px 12px; cursor: pointer;
  color: var(--gris); font-size: 14px; font-weight: 600; transition: background .15s, color .15s;
}
nav.menu button .ico { width: 18px; height: 18px; }
nav.menu button:hover { background: var(--papel); color: var(--tinta); }
nav.menu button[aria-current=page] { background: var(--papel); color: var(--tinta); }
nav.menu button[aria-current=page]::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acento);
}
nav.menu .contador {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--alerta); color: #fff;
  font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
}
.marcar-yo {
  display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 9px 12px; border-radius: 10px;
  color: var(--tinta-2); text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--linea);
  transition: background .15s, box-shadow .15s;
}
.marcar-yo .ico { width: 18px; height: 18px; color: var(--gris); }
.marcar-yo:hover { background: var(--papel); box-shadow: inset 0 0 0 1px var(--linea-2); }
.lateral .yo { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 6px 2px; border-top: 1px solid var(--linea); }
.lateral .yo .nombre { font-weight: 650; font-size: 13.5px; line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lateral .yo .nombre small { display: block; color: var(--gris); font-weight: 500; font-size: 12px; }
.lateral .yo button {
  margin-left: auto; background: none; color: var(--gris); border: 0; border-radius: 9px;
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; flex: none; transition: background .15s, color .15s;
}
.lateral .yo button:hover { background: var(--papel); color: var(--tinta); }
.lateral .yo button .ico { width: 18px; height: 18px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--tinta); color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
}
.avatar .ico { width: 15px; height: 15px; }
.avatar.gris { background: var(--papel-2); color: var(--tinta-2); }
.avatar.chico { width: 30px; height: 30px; font-size: 11.5px; }

/* ---------- contenido ---------- */
main.contenido { padding: 40px clamp(24px, 3.6vw, 56px) 88px; max-width: 1380px; width: 100%; }
.vista-panel { animation: aparece .25s ease-out; }
.cabeza { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 20px; margin-bottom: 28px; }
.cabeza > div:first-child { min-width: 0; flex: 1 1 380px; }
.cabeza h1 { font-size: 30px; line-height: 1.12; font-weight: 750; letter-spacing: -.03em; margin: 0; }
.cabeza h1::first-letter { text-transform: uppercase; }
.cabeza .bajada { color: var(--gris); margin: 8px 0 0; max-width: 74ch; font-size: 14.5px; line-height: 1.6; text-wrap: pretty; }
.cabeza .acciones { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.panel-caja { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-3); padding: 20px 22px; }
.panel-caja.separado { margin-top: 20px; }
.panel-caja h2, .seccion-titulo { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 14px; }
.vacio {
  color: var(--gris); padding: 48px 24px; text-align: center; background: var(--superficie);
  border: 1px dashed var(--linea-2); border-radius: var(--r-3); font-size: 14.5px;
}
.vacio .ico { display: block; width: 26px; height: 26px; margin: 0 auto 12px; color: var(--gris-2); }
.vacio.malo { color: var(--alerta); border-color: #EBC3BE; background: #FFFBFA; }
.vacio.malo .ico { color: var(--alerta); }
.esqueleto { display: grid; gap: 10px; }
.esqueleto i {
  display: block; height: 48px; border-radius: var(--r-2);
  background: linear-gradient(90deg, var(--papel-2) 0%, #F7F8F6 40%, var(--papel-2) 80%) 0 0 / 300% 100%;
  animation: brillo 1.4s ease-in-out infinite;
}
.esqueleto i:nth-child(2) { opacity: .7; } .esqueleto i:nth-child(3) { opacity: .4; }
@keyframes brillo { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- indicadores: una sola franja dividida ---------- */
.conteos {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px;
  margin: 0 0 24px; padding: 0; list-style: none;
  background: var(--linea); border: 1px solid var(--linea); border-radius: var(--r-3); overflow: hidden;
}
.conteos li {
  background: var(--superficie); padding: 18px 20px 20px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "ico txt" "num num"; column-gap: 8px; row-gap: 12px; align-items: start;
}
.conteos span:last-child::first-letter { text-transform: uppercase; }
.conteos .kpi-ico { grid-area: ico; color: var(--gris-2); display: grid; margin-top: 1px; }
.conteos .kpi-ico .ico { width: 16px; height: 16px; }
.conteos b { grid-area: num; align-self: end; font-size: 32px; line-height: 1; font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.conteos span:last-child { grid-area: txt; color: var(--gris); font-size: 13px; font-weight: 550; line-height: 1.3; }
.conteos .bueno .kpi-ico { color: var(--ok); }
.conteos .malo .kpi-ico, .conteos .malo b { color: var(--alerta); }

/* ---------- hoy ---------- */
.obras { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.obra-tarjeta { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-3); overflow: hidden; }
.obra-tarjeta header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--linea); }
.obra-tarjeta header .ico { color: var(--gris-2); width: 18px; height: 18px; }
.obra-tarjeta h2 { font-size: 16px; font-weight: 700; letter-spacing: -.015em; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obra-tarjeta .pastilla { margin-left: auto; }
.obra-tarjeta .cuerpo { padding: 4px 20px 14px; }
.obra-tarjeta h3 { font-size: 12.5px; font-weight: 650; color: var(--gris); margin: 14px 0 2px; }
.personas { list-style: none; margin: 0; padding: 0; }
.personas li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.personas li:last-child { border-bottom: 0; }
.personas .quien { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.personas .dato { color: var(--gris); white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12.5px; text-align: right; line-height: 1.45; }
.marca-alerta { color: var(--alerta); font-weight: 650; }
.marca-alerta .ico { width: 15px; height: 15px; vertical-align: -.2em; }
.sinmarcar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sinmarcar li {
  display: inline-flex; align-items: center; gap: 9px; padding: 4px 14px 4px 4px; border-radius: 999px;
  background: var(--superficie); box-shadow: inset 0 0 0 1px var(--linea); font-weight: 550; font-size: 13.5px;
}
.sinmarcar li .avatar { width: 26px; height: 26px; font-size: 10.5px; background: var(--papel-2); color: var(--tinta-2); }
.sinmarcar li.nota { padding: 4px 0; background: none; box-shadow: none; }

/* ---------- alertas ---------- */
.alerta {
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-3); padding: 20px 22px; margin-bottom: 12px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; animation: aparece .25s ease-out;
}
.alerta > .ico-caja { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--alerta-suave); color: var(--alerta); grid-row: span 4; }
.alerta > .ico-caja .ico { width: 18px; height: 18px; }
.alerta .titulo { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.alerta .titulo strong { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.alerta .titulo > span:not(.nota) { font-weight: 550; color: var(--tinta-2); }
.alerta .motivo { color: var(--alerta); font-weight: 600; margin: 6px 0 14px; font-size: 14px; }
.alerta .botones { display: flex; gap: 8px; flex-wrap: wrap; }
.fotos { display: flex; gap: 12px; flex-wrap: wrap; margin: 2px 0 16px; }
.fotos figure { margin: 0; width: 148px; }
.fotos figure img {
  width: 148px; height: 148px; object-fit: cover; border-radius: var(--r-2); display: block; cursor: zoom-in;
  background: linear-gradient(90deg, var(--papel-2) 0%, #F7F8F6 40%, var(--papel-2) 80%) 0 0 / 300% 100%; animation: brillo 1.4s ease-in-out infinite;
  transition: transform .2s var(--suave-in), box-shadow .2s;
}
.fotos figure img[src] { animation: none; background: var(--grafito); }
.fotos figure img[src]:hover { transform: scale(1.02); box-shadow: var(--sombra-2); }
.fotos figcaption { font-size: 12px; color: var(--gris); margin-top: 7px; line-height: 1.4; }
.fotos figcaption b { color: var(--tinta); font-weight: 650; }

/* ---------- filtros y tablas ---------- */
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 16px; align-items: end; margin-bottom: 16px; }
.filtros label { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--gris); }
.filtros > div { min-width: 0; }
.filtros input, .filtros select { min-width: 0; min-height: 42px; font-size: 14px; padding-top: 8px; padding-bottom: 8px; }
.filtros .botonera { display: flex; gap: 8px; }
.filtros .botonera .btn { flex: 1; }
.tabla-caja { overflow-x: auto; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-3); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--gris); padding: 12px 16px; white-space: nowrap;
  background: #FAFAF8; border-bottom: 1px solid var(--linea); position: sticky; top: 0;
}
td { padding: 13px 16px; border-bottom: 1px solid var(--linea); vertical-align: middle; white-space: nowrap; }
#j-res table { font-size: 13.5px; }
#j-res :is(th, td) { padding-left: 12px; padding-right: 12px; }
#j-res :is(th, td):first-child { padding-left: 18px; }
#j-res :is(th, td):last-child { padding-right: 18px; }
#j-res .celda-persona .avatar { display: none; }
#j-res td:nth-child(10) { white-space: normal; min-width: 150px; max-width: 280px; font-size: 13px; color: var(--tinta-2); }
/* La tabla de jornadas es ancha y se desliza de lado: la columna Fotos queda fija a la derecha. */
#j-res thead th:last-child, #j-res tbody tr:not(.fila-fotos) > td:last-child, #j-res tfoot td:last-child {
  position: sticky; right: 0; z-index: 1; background: var(--superficie); box-shadow: -12px 0 12px -12px rgba(22, 26, 30, .22);
}
#j-res thead th:last-child, #j-res tfoot td:last-child { background: #FAFAF8; z-index: 2; }
#j-res tbody tr:not(.fila-fotos):hover > td:last-child { background: #FAFAF8; }
#j-res td:first-child .estado { display: flex; width: max-content; margin-top: 4px; }
#j-res td:nth-child(10) .nota { font-size: 12px; margin-top: 2px; }
tbody tr { transition: background .12s; }
tbody tr:hover > td { background: #FAFAF8; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.acc { white-space: nowrap; text-align: right; }
td.acc .btn { margin-left: 6px; }
.celda-persona { display: flex; align-items: center; gap: 11px; font-weight: 600; }
tr.inactivo td { color: var(--gris-2); }
tr.inactivo .avatar { opacity: .55; }
tfoot td { font-weight: 700; background: #FAFAF8; border-top: 1px solid var(--linea); border-bottom: 0; font-variant-numeric: tabular-nums; }
.estado, .pastilla {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 650; background: var(--papel); color: var(--tinta-2); white-space: nowrap; line-height: 1.5;
}
.estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.estado.si { background: var(--ok-suave); color: var(--ok); }
.estado.no { background: var(--papel); color: var(--gris); }
.estado.pend { background: var(--acento-suave); color: var(--acento-tinta); }
.estado.mal { background: var(--alerta-suave); color: var(--alerta); }
.pastilla.amarilla { background: var(--acento-suave); color: var(--acento-tinta); }
.buscar-caja { position: relative; }
.buscar-caja .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--gris-2); pointer-events: none; width: 17px; height: 17px; }
.buscar-caja input { padding-left: 40px; width: 300px; max-width: 100%; min-height: 42px; }
.nota-tabla { margin: 14px 4px 0; line-height: 1.6; max-width: 90ch; }
tr.fila-fotos > td { background: var(--papel) !important; }
tr.fila-fotos .fotos { margin: 6px 0; }
.btn-foto {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--papel); color: var(--tinta);
  border-radius: var(--r-1); padding: 5px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.btn-foto .ico { width: 15px; height: 15px; }
.btn-foto:hover { background: var(--papel-2); }
.nota-campo { margin: 8px 0 0; line-height: 1.55; }

@media (min-width: 1180px) {
  #f-jor { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #f-jor .botonera { grid-column: span 2; justify-content: flex-end; }
  #f-pob { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
  :is(#f-jor, #f-pob) .botonera .btn { flex: 0 0 auto; min-width: 116px; }
}

/* ---------- horas por obra ---------- */
.rapidos { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.rapidos button {
  border: 0; background: var(--superficie); color: var(--tinta-2); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: inset 0 0 0 1px var(--linea); transition: background .15s, box-shadow .15s;
}
.rapidos button:hover { background: var(--papel); box-shadow: inset 0 0 0 1px var(--linea-2); }
.barrita { height: 4px; background: var(--papel-2); border-radius: 2px; margin-top: 7px; min-width: 96px; overflow: hidden; }
.barrita i { display: block; height: 100%; background: var(--tinta); border-radius: 2px; }
tr.obra-fila { cursor: pointer; }
tr.obra-fila td:first-child { font-weight: 650; white-space: nowrap; }
tr.obra-fila .flecha {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 6px;
  background: var(--papel); color: var(--gris); transition: transform .2s var(--suave-in), background .15s; vertical-align: middle;
}
tr.obra-fila .flecha .ico { width: 14px; height: 14px; }
tr.obra-fila[aria-expanded=true] .flecha { transform: rotate(90deg); background: var(--tinta); color: #fff; }
tr.obra-fila:focus-visible { outline-offset: -2px; }
tr.persona td { background: #FBFBFA; font-size: 13px; }
tr.persona td:first-child { padding-left: 46px; }
tr.persona .barrita i { background: var(--gris-2); }

/* ---------- zona de peligro ---------- */
.peligro-zona { margin-top: 36px; border-color: #EFCFCB; }
.peligro-zona h2 { color: var(--alerta); display: flex; align-items: center; gap: 8px; }
.peligro-zona h2 .ico { width: 18px; height: 18px; }
.peligro-texto { margin: 0 0 16px; font-size: 14px; line-height: 1.6; max-width: 72ch; }

/* ---------- diálogos ---------- */
dialog {
  border: 0; border-radius: var(--r-4); padding: 28px; width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px); overflow-y: auto;
  box-shadow: var(--sombra-3); color: var(--tinta); background: var(--superficie);
}
dialog[open] { animation: sube .26s var(--suave-in); }
dialog::backdrop { background: rgba(22, 26, 30, .38); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: aparece .2s ease-out; }
@keyframes sube { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
dialog h2 { font-size: 21px; font-weight: 750; letter-spacing: -.025em; margin: 0 0 4px; line-height: 1.2; }
dialog form > label:first-of-type { margin-top: 20px; }
dialog .pie { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.dialogo-texto { margin: 6px 0 0; font-size: 14px; line-height: 1.6; }
.check.junto { margin-top: 10px; }
#dr-texto { color: var(--tinta-2); margin: 8px 0 0; line-height: 1.55; }
.revelar { background: var(--papel); border: 1px dashed var(--linea-2); border-radius: var(--r-3); padding: 22px 18px; text-align: center; margin: 18px 0 10px; }
.revelar b { display: block; font-size: 46px; line-height: 1.05; font-weight: 350; letter-spacing: .18em; font-variant-numeric: tabular-nums; margin-right: -.18em; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.aviso-flotante {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px);
  background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  box-shadow: var(--sombra-3); animation: toast .3s var(--suave-in);
}
.aviso-flotante::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--acento); flex: none; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- tableta y celular: barra superior y menú deslizable ---------- */
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .barra {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
    background: rgba(243, 244, 241, .86); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--linea);
  }
  .barra-boton {
    width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px;
    background: none; color: var(--tinta); cursor: pointer; text-decoration: none; transition: background .15s;
  }
  .barra-boton:hover, .barra-boton:active { background: var(--papel-2); }
  .barra-boton .ico { width: 21px; height: 21px; }
  .barra-titulo { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .velo {
    display: block; position: fixed; inset: 0; z-index: 35; background: rgba(22, 26, 30, .38);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: aparece .2s ease-out;
  }
  .velo[hidden] { display: none !important; }
  .lateral {
    position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; height: auto; width: min(300px, 86vw);
    padding: calc(22px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
    border-right: 0; box-shadow: var(--sombra-3);
    transform: translateX(-104%); visibility: hidden;
    transition: transform .3s var(--suave-in), visibility 0s linear .3s;
  }
  body.menu-abierto { overflow: hidden; }
  body.menu-abierto .lateral { transform: none; visibility: visible; transition: transform .3s var(--suave-in), visibility 0s; }
  nav.menu button { padding: 11px 12px; font-size: 15px; }
  main.contenido { padding: 28px 24px 72px; }
}

@media (max-width: 720px) {
  main.contenido { padding: 22px 16px calc(72px + env(safe-area-inset-bottom, 0px)); }
  .cabeza { margin-bottom: 20px; gap: 14px; }
  .cabeza > div:first-child { flex-basis: 100%; }
  .cabeza h1 { font-size: 25px; }
  .cabeza .bajada { font-size: 14px; }
  .cabeza .acciones { margin-left: 0; width: 100%; }
  .cabeza .acciones > .btn:only-child { flex: 1; }
  .buscar-caja { flex: 1 1 100%; }
  .buscar-caja input { width: 100%; }
  .buscar-caja + .btn { flex: 1; }
  .conteos { grid-auto-flow: row; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
  .conteos li { padding: 14px 16px 16px; row-gap: 8px; }
  .conteos li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .conteos b { font-size: 27px; }
  .obras { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .obra-tarjeta header, .obra-tarjeta .cuerpo { padding-left: 16px; padding-right: 16px; }
  .panel-caja { padding: 18px 16px; }
  .filtros { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .filtros .botonera { grid-column: 1 / -1; }
  .alerta { padding: 16px; column-gap: 12px; }
  .alerta > .ico-caja { width: 32px; height: 32px; }
  .fotos figure, .fotos figure img { width: 128px; }
  .fotos figure img { height: 128px; }
  .dos { grid-template-columns: 1fr; }
  .dos > div:last-child > label { display: none; }
  .dos > div:last-child .btn { margin-top: 12px; }
  .aviso-flotante { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); border-radius: 14px; }

  /* diálogos como hoja que sube desde abajo */
  dialog {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--r-4) var(--r-4) 0 0;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px)); max-height: 92dvh;
  }
  dialog[open] { animation: hoja .32s var(--suave-in); }
  @keyframes hoja { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  dialog .pie { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom, 0px)); background: var(--superficie); margin: 22px -20px calc(-20px - env(safe-area-inset-bottom, 0px)); padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
  dialog .pie .btn { flex: 1; min-height: 48px; }
  .revelar b { font-size: 40px; }

  /* Trabajadores, obras y administradores: cada fila se vuelve una tarjeta. */
  :is(#t-lista, #o-lista, #ad-lista) .tabla-caja { background: none; border: 0; border-radius: 0; overflow: visible; }
  :is(#t-lista, #o-lista, #ad-lista) :is(table, tbody) { display: block; }
  :is(#t-lista, #o-lista, #ad-lista) thead { display: none; }
  :is(#t-lista, #o-lista, #ad-lista) tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center;
    background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-3); padding: 14px 16px; margin-bottom: 10px;
  }
  :is(#t-lista, #o-lista, #ad-lista) tbody tr:hover > td { background: none; }
  :is(#t-lista, #o-lista, #ad-lista) td { display: block; padding: 0; border: 0; text-align: left; font-size: 13.5px; color: var(--gris); }
  :is(#t-lista, #o-lista, #ad-lista) td:first-child { grid-column: 1 / -1; color: var(--tinta); font-size: 15px; margin-bottom: 2px; }
  :is(#t-lista, #o-lista, #ad-lista) td:nth-child(2) { grid-row: 2; grid-column: 1; }
  :is(#t-lista, #ad-lista) td:nth-child(3) { grid-row: 2; grid-column: 2; }
  :is(#t-lista, #ad-lista) td:nth-child(4) { grid-row: 3; grid-column: 1 / -1; }
  #o-lista td:nth-child(3) { grid-row: 3; grid-column: 1 / -1; }
  #o-lista td:nth-child(4) { grid-row: 2; grid-column: 2; }
  :is(#t-lista, #ad-lista) td:nth-child(2)::before { content: "Cédula "; }
  #t-lista td:nth-child(4)::before { content: "Autorizó datos: "; }
  #ad-lista td:nth-child(4)::before { content: "Último ingreso: "; }
  #o-lista td:nth-child(3)::before { content: "Radio permitido: "; }
  :is(#t-lista, #o-lista, #ad-lista) td.acc {
    grid-row: 4; grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap;
    margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--linea);
  }
  :is(#t-lista, #o-lista, #ad-lista) td.acc .btn { margin: 0; flex: 1; min-height: 38px; }
  :is(#t-lista, #o-lista, #ad-lista) tr.inactivo td:first-child { color: var(--gris); }

  /* Jornadas en el celular: las fotos abiertas se muestran donde se está mirando, no al comienzo de la fila. */
  #j-res tr.fila-fotos .fotos { position: sticky; left: 12px; width: calc(100vw - 72px); }
}
