* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: #f4f5f7;
  color: #1c1c1e;
}
header {
  background: #1c2b3a;
  color: #fff;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
header h1 { font-size: 1.1rem; margin: 0; }
header .logout {
  color: #cfd8e3; text-decoration: none; font-size: 0.9rem;
  padding: 0.4rem 0.2rem; /* área táctil más cómoda */
}
.pestañas {
  display: flex; gap: 0.25rem; background: #16222e; padding: 0 1rem;
}
.pestañas a {
  color: #cfd8e3; text-decoration: none; font-size: 0.9rem;
  padding: 0.75rem 1rem; border-bottom: 3px solid transparent;
}
.pestañas a.activa { color: #fff; border-bottom-color: #4da3ff; font-weight: 600; }

main { padding: 1rem; max-width: 1200px; margin: 0 auto; }

.flash {
  background: #fdecea; color: #a4262c; border: 1px solid #f3b8b8;
  padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem;
}

.login-form {
  display: flex; flex-direction: column; gap: 1rem;
  max-width: 320px; width: 100%; margin: 2rem auto; background: #fff;
  padding: 1.5rem; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.login-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; }
.login-form input {
  padding: 0.6rem; border: 1px solid #ccc; border-radius: 4px;
  font-size: 16px; /* evita el zoom automático de iOS/Android al enfocar */
}
.login-form button {
  padding: 0.8rem; background: #1c2b3a; color: #fff; border: none;
  border-radius: 4px; cursor: pointer; font-size: 1rem;
}

.aviso {
  background: #fff8e1; border: 1px solid #f0d78c; color: #6b5900;
  padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem;
}

.resumen {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center;
  margin-bottom: 1rem; font-size: 0.9rem;
}
.resumen span { font-weight: 600; }
.resumen a { padding: 0.3rem 0; } /* área táctil */

.tabla-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 8px;
}
table { width: 100%; min-width: 640px; border-collapse: collapse; }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid #eee; font-size: 0.9rem; white-space: nowrap; }
td.motivo { white-space: normal; }
th { background: #eef1f5; }
tr.descartada { color: #888; }
td.motivo { font-size: 0.8rem; color: #a4262c; max-width: 280px; }

.orden-link { color: inherit; text-decoration: none; }
.orden-link:hover { text-decoration: underline; }

.buscador {
  display: flex; align-items: center; gap: 0.5rem;
  width: 260px; max-width: 100%;
}
.buscador input {
  flex: 1; padding: 0.5rem 0.7rem; border: 1px solid #ccc; border-radius: 4px; font-size: 16px;
}
.buscador button {
  border: none; background: #dde3ea; color: #1c2b3a; border-radius: 4px;
  width: 2rem; height: 2rem; font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.buscador button:hover { background: #cbd3dc; }
#sin-resultados-busqueda { padding: 1rem; margin: 0; font-size: 0.9rem; color: #888; }

.ficha-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; /* área táctil cómoda en móvil */
  border-radius: 6px; background: #eef1f5; color: #1c2b3a;
  text-decoration: none; font-weight: 700;
}
.ficha-link:hover { background: #dde3ea; }

.filtros {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.6rem; align-items: flex-end;
  background: #fff; border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem;
}
.filtros label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; }
.filtros input, .filtros select {
  padding: 0.4rem 0.5rem; border: 1px solid #ccc; border-radius: 4px; font-size: 16px;
}
.filtros input[type="text"], .filtros input[type="number"] { width: 8rem; }
.filtros select { width: 9.5rem; }
.filtros label.check { flex-direction: row; align-items: center; gap: 0.35rem; font-size: 0.82rem; white-space: nowrap; }
.filtros-botones { display: flex; gap: 0.6rem; align-items: center; }
.filtros-botones button {
  padding: 0.45rem 0.9rem; background: #1c2b3a; color: #fff; border: none;
  border-radius: 4px; cursor: pointer; font-size: 0.85rem; white-space: nowrap;
}
.filtros-botones a { font-size: 0.8rem; color: #555; white-space: nowrap; }

@media (max-width: 480px) {
  main { padding: 0.75rem; }
  header { padding: 0.75rem; }
  header h1 { font-size: 1rem; }
  .aviso, .resumen { font-size: 0.85rem; }
  .filtros input[type="text"], .filtros input[type="number"], .filtros select { width: 100%; }
  .buscador { max-width: 100%; }
}
