/* Parcial historial_rtv.html: tarjeta de resultados + tabla de certificados.
   Lo enlaza resultados_rtv.html. Usa var(--x, fallback) para poder
   renderizarse también sin resultados_rtv.css. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Tarjeta de resultados ---------- */
.results-card {
  background-color: #fff;
  border: 1px solid var(--line, #dbe2e6);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 18px 40px rgba(16, 35, 43, .07));
  overflow: hidden;
}

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  padding: clamp(16px, 2.5vw, 22px) clamp(16px, 3vw, 26px);
  border-bottom: 1px solid var(--line, #dbe2e6);
  background-image: linear-gradient(180deg, #fbfdfd, #f1f6f7);
}

.results-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.results-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background-image: linear-gradient(160deg, #0a8d9a, #06707c);
  color: #fff;
  box-shadow: 0 6px 14px rgba(8, 127, 140, .28);
  flex-shrink: 0;
}
.results-head-icon svg { width: 22px; height: 22px; }

.results-head-text { min-width: 0; }

.results-title {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.25;
  color: var(--ink, #16232b);
}

/* Placa y chasis como etiquetas separadas, no como una linea corrida */
.results-datos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.dato {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 10px;
  border: 1px solid var(--line, #dbe2e6);
  border-radius: 999px;
  background-color: #fff;
}

.dato-etiqueta {
  padding: 2px 8px;
  border-radius: 999px;
  background-color: #eef4f5;
  color: var(--muted, #64747e);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.dato-valor {
  color: var(--ink, #16232b);
  font-size: .84rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.results-count {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 18px;
  border: 1px solid rgba(8, 127, 140, .18);
  border-radius: 999px;
  background-color: rgba(8, 127, 140, .1);
  color: var(--accent, #087f8c);
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}
.results-count strong { font-size: 1.05rem; }

/* ---------- Tabla ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.table-wrap th,
.table-wrap td {
  padding: 14px 18px;
  border-bottom: 1px solid #eef2f3;
  text-align: left;
  white-space: nowrap;
}

.table-wrap th {
  background-color: #f4f8f9;
  color: #3f515a;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* La fila de titulos se separa del cuerpo con una linea de acento */
.table-wrap thead th {
  padding-top: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(8, 127, 140, .22);
}

.table-wrap td { font-variant-numeric: tabular-nums; }
.table-wrap tbody tr:nth-child(even) { background-color: #fbfdfd; }
.table-wrap tbody tr:hover { background-color: #f3f9fa; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap td.cell-strong { font-weight: 600; }
.table-wrap td.cell-action { text-align: right; }

/* ---------- Etiquetas de estado ---------- */
.status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.status-1 { background-color: #d9f4e1; color: #166534; }
.status-2 { background-color: #fff0c2; color: #8a5a00; }
.status-3 { background-color: #ffe0df; color: #9b2c2c; }

/* ---------- Botón "Mostrar" (abre el PDF) ---------- */
.print-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 20px;
  border-radius: 8px;
  background-image: linear-gradient(180deg, #0a8d9a, #06707c);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(8, 127, 140, .24);
  transition: filter .15s, box-shadow .15s, transform .12s;
}
.print-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.print-link:hover { filter: brightness(1.07); box-shadow: 0 8px 18px rgba(8, 127, 140, .3); }
.print-link:active { transform: translateY(1px); }
.print-link:focus-visible { outline: 3px solid rgba(8, 127, 140, .4); outline-offset: 2px; }

/* ---------- Sin resultados ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: clamp(28px, 5vw, 48px) 22px;
  background-color: #fff;
  border: 1px solid var(--line, #dbe2e6);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 18px 40px rgba(16, 35, 43, .07));
  text-align: center;
}
.empty-state-icon { width: 40px; height: 40px; color: var(--accent, #087f8c); opacity: .7; }
.empty-state-title { font-size: 1.05rem; color: var(--ink, #16232b); }
.empty-state-text {
  margin: 0;
  max-width: 46ch;
  color: var(--muted, #64747e);
  font-size: .92rem;
}

/* ---------- Adaptabilidad: la tabla pasa a tarjetas ---------- */
@media (max-width: 760px) {
  .results-head-icon { width: 38px; height: 38px; border-radius: 10px; }
  .results-head-icon svg { width: 19px; height: 19px; }
  .table-wrap { overflow: visible; }
  .table-wrap table { min-width: 0; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: block; }
  .table-wrap tbody tr {
    display: block;
    padding: 4px 0;
    border-bottom: 1px solid #eef2f3;
  }
  .table-wrap tbody tr:nth-child(even) { background-color: transparent; }
  .table-wrap tbody tr:last-child { border-bottom: 0; }
  .table-wrap td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 20px;
    border-bottom: 0;
    white-space: normal;
    text-align: right;
  }
  .table-wrap td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted, #64747e);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .table-wrap td.cell-action { padding-top: 13px; }
  .table-wrap td.cell-action::before { display: none; }
  .table-wrap .print-link { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .print-link { transition: none; }
}


