/* Certificados de recogida (Subproductos) */
#sub-panel-cert .crt-sec { margin-top: 16px; }
.crt-filtros { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.crt-filtros .form-group { margin: 0; min-width: 0; }
.crt-filtros input[type="date"] { width: 100%; }
.crt-prov .cw-search-wrap, .crt-prov .cw-search-input { width: 100%; }
.crt-aviso { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-hover); font-size: 13px; line-height: 1.45; color: var(--text-secondary); }
#crt-viajes-sec .form-group { margin: 0 0 12px; }
#crt-material { width: 100%; }
#tabla-crt td, #tabla-crt th { white-space: nowrap; font-variant-numeric: tabular-nums; }
#tabla-crt .crt-chk { width: 36px; }
#tabla-crt input[type="checkbox"] { width: 18px; height: 18px; margin: 0; vertical-align: middle; }
#tabla-crt .crt-celda { width: 104px; min-height: 34px; height: 34px; padding: 4px 8px; font-size: 13px; }
#tabla-crt .crt-celda.crt-kg { text-align: right; }
#tabla-crt tr.crt-fuera td:not(.crt-chk) { opacity: .45; }
#tabla-crt small { display: block; font-size: 12px; color: var(--text-secondary); }
#tabla-crt-emitidos td { font-variant-numeric: tabular-nums; }
.crt-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 14px; }
.crt-pie strong { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.crt-excel { cursor: pointer; }
@media (max-width: 800px) {
  .crt-filtros { grid-template-columns: 1fr 1fr; }
  .crt-filtros .crt-prov { grid-column: 1 / -1; }
  .crt-pie strong { margin-left: 0; flex: 1 1 100%; }
  .crt-pie .btn { flex: 1 1 auto; }
}
/* En el móvil cada viaje es una tarjeta: sin deslizar de lado */
@media (max-width: 640px) {
  #tabla-crt, #tabla-crt tbody, #tabla-crt thead { display: block; width: 100%; }
  #tabla-crt thead tr { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
  #tabla-crt thead th { display: none; padding: 0; border: 0; }
  #tabla-crt thead th.crt-chk { display: block; width: auto; }
  #tabla-crt thead tr::after { content: 'Marcar todos'; font-size: 13px; color: var(--text-secondary); }
  #tabla-crt tbody tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 3px; padding: 10px 12px; border-top: 1px solid var(--border); }
  #tabla-crt tbody td { display: block; padding: 0 !important; border: 0 !important; background: none !important; white-space: normal; min-width: 0; }
  #tabla-crt tbody td.crt-chk { grid-row: 1 / span 4; }
  #tabla-crt tbody td:nth-child(2) { grid-column: 2; grid-row: 1; font-size: 13px; color: var(--text-secondary); }
  #tabla-crt tbody td:nth-child(7) { grid-column: 3; grid-row: 1; font-weight: 600; white-space: nowrap; }
  #tabla-crt tbody td:nth-child(3) { grid-column: 2 / -1; grid-row: 2; }
  #tabla-crt tbody td:nth-child(4) { grid-column: 2 / -1; font-size: 13px; color: var(--text-secondary); }
  #tabla-crt tbody td:nth-child(5), #tabla-crt tbody td:nth-child(6) { grid-column: 2 / -1; font-size: 13px; }
  #tabla-crt .crt-celda { width: 100%; height: 40px; font-size: 16px; }
  #tabla-crt-emitidos, #tabla-crt-emitidos tbody { display: block; width: 100%; }
  #tabla-crt-emitidos thead { display: none; }
  #tabla-crt-emitidos tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--border); }
  #tabla-crt-emitidos tbody tr:first-child { border-top: 0; }
  #tabla-crt-emitidos tbody td { display: block; padding: 0 !important; border: 0 !important; background: none !important; min-width: 0; }
  #tabla-crt-emitidos tbody td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 13px; color: var(--text-secondary); }
  #tabla-crt-emitidos tbody td:nth-child(2) { grid-column: 1; grid-row: 2; font-weight: 600; }
  #tabla-crt-emitidos tbody td:is(:nth-child(3), :nth-child(4)) { display: none; }
  #tabla-crt-emitidos tbody td:nth-child(5) { grid-column: 2; grid-row: 1; font-weight: 600; }
  #tabla-crt-emitidos tbody td:nth-child(6) { grid-column: 2; grid-row: 2; }
}
