
:root {
  --rojo: #c8231a;
  --rojo-oscuro: #a91c15;
  --azul: #0056b3;
  --fondo: #f4f5f7;
  --texto: #222;
  --borde: #ddd;
  --suave: #fafafa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.5;
}

.container {
  max-width: 1280px;
  margin: 24px auto;
  padding: 24px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

.header {
  display: flex;
  gap: 20px;
  align-items: center;
  border-bottom: 1px solid var(--borde);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.header img {
  max-height: 70px;
  max-width: 220px;
  object-fit: contain;
}

.header-title h1 {
  margin: 0 0 4px 0;
  color: var(--rojo);
  font-size: 2rem;
}

.header-title p {
  margin: 0;
  color: #555;
}

h2 {
  color: #333;
  margin-top: 26px;
}

.notice {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 8px;
  padding: 14px;
  margin: 18px 0;
}

.info-box {
  background: #eef5ff;
  border: 1px solid #cfe2ff;
  border-radius: 8px;
  padding: 14px;
  margin: 18px 0;
}

.search-box {
  background: #f1f1f1;
  padding: 18px;
  border-radius: 10px;
  margin: 20px 0;
}

label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
}

input[type="search"],
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #bbb;
  border-radius: 7px;
  font-size: 1rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 12px;
  margin-top: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.button,
button {
  display: inline-block;
  padding: 10px 14px;
  border: 0;
  border-radius: 7px;
  background: var(--rojo);
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
}

.button:hover,
button:hover {
  background: var(--rojo-oscuro);
}

.button.secondary {
  background: #555;
}

.button.light {
  background: #0d6efd;
}

.results-info {
  font-weight: bold;
  margin: 14px 0;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--borde);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1150px;
}

th,
td {
  padding: 9px;
  border-bottom: 1px solid var(--borde);
  text-align: left;
  vertical-align: top;
}

th {
  background: #eee;
  font-weight: bold;
}

tr:hover {
  background: var(--suave);
}

.pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pagination button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.empty {
  background: #f8d7da;
  border: 1px solid #f5c2c7;
  color: #842029;
  border-radius: 8px;
  padding: 14px;
  margin: 16px 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: 14px;
  margin: 18px 0;
}

.card {
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  min-height: 150px;
}

.card img {
  max-width: 160px;
  max-height: 70px;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
}

.card h3 {
  margin: 4px 0 8px 0;
  color: var(--rojo);
  font-size: 1.05rem;
}

.card p {
  margin: 4px 0 10px 0;
}

.card .type {
  display: inline-block;
  font-size: .85rem;
  padding: 3px 7px;
  border-radius: 12px;
  background: #eee;
  margin-bottom: 8px;
}

.footer {
  margin-top: 30px;
  background: #f0f0f0;
  padding: 16px;
  border-radius: 10px;
}

.small {
  font-size: .9rem;
  color: #555;
}

@media (max-width: 760px) {
  .container {
    margin: 8px;
    padding: 16px;
  }

  .header {
    display: block;
  }

  .header img {
    margin-bottom: 12px;
  }

  .header-title h1 {
    font-size: 1.55rem;
  }

  .button {
    width: 100%;
    text-align: center;
  }
}


/* AJUSTES VISUALES DISMADEL - V2 */

.header {
  align-items: center;
}

.header img {
  max-height: 82px;
  max-width: 260px;
}

.header-title h1 span {
  font-size: 1.35rem;
  color: #333;
}

.lotes-actions .button {
  min-width: 92px;
  text-align: center;
}

.compact-cards {
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
}

.compact-card {
  min-height: 118px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.compact-card img {
  max-width: 118px;
  max-height: 44px;
  object-fit: contain;
  margin-bottom: 6px;
}

.compact-card h3 {
  font-size: .93rem;
  line-height: 1.25;
  margin: 4px 0 8px 0;
  color: #222;
}

.compact-card .actions {
  margin: 6px 0 0 0;
  gap: 6px;
}

.compact-card .button {
  padding: 7px 9px;
  font-size: .82rem;
}

.info-box {
  font-size: 1rem;
}

@media (min-width: 1000px) {
  .compact-cards {
    grid-template-columns: repeat(7, 1fr);
  }
}

@media (max-width: 760px) {
  .compact-cards {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  }

  .compact-card .button {
    width: auto;
  }
}


/* AJUSTES VISUALES V3 */

/* Cabecera con logo, título y contacto */
.header-v3 {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) minmax(330px, 430px);
  gap: 18px;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.header-logo {
  display: flex;
  align-items: center;
}

.logo-dismadel {
  max-height: 88px;
  max-width: 245px;
  object-fit: contain;
}

.header-title h1 {
  margin: 0 0 2px 0;
  color: var(--rojo);
  font-size: 1.7rem;
  line-height: 1.1;
}

.header-title .expediente {
  margin: 2px 0 5px 0;
  font-weight: bold;
  color: #111;
  font-size: 1rem;
}

.header-title p {
  margin: 0;
  color: #555;
  font-size: .9rem;
}

.header-contact {
  background: #f6f6f6;
  border: 1px solid #ddd;
  border-left: 5px solid var(--rojo);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: .84rem;
  line-height: 1.25;
  color: #222;
}

.header-contact p {
  margin: 5px 0 0 0;
  font-size: .76rem;
  color: #555;
  line-height: 1.25;
}

/* Lotes en una sola línea en escritorio */
.lotes-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.lotes-actions .button {
  flex: 1 0 auto;
  min-width: 58px;
  padding: 8px 7px;
  font-size: .82rem;
  text-align: center;
  white-space: nowrap;
}

/* En pantallas anchas, forzamos 14 columnas equilibradas */
@media (min-width: 1100px) {
  .lotes-actions {
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    gap: 6px;
    overflow-x: visible;
  }

  .lotes-actions .button {
    min-width: 0;
    width: 100%;
    padding: 8px 4px;
  }
}

/* Mensaje sin resultados más visible */
.empty {
  background: #fff0f0 !important;
  border: 2px solid #c8231a !important;
  border-left: 8px solid #c8231a !important;
  color: #7a1111 !important;
  font-weight: bold;
  font-size: 1.02rem;
  box-shadow: 0 3px 10px rgba(200, 35, 26, .12);
}

.empty::before {
  content: "Atención: ";
  color: #c8231a;
  font-weight: 800;
}

/* Ajuste fino de tarjetas de catálogos */
.compact-card {
  min-height: 108px;
}

.compact-card h3 {
  font-size: .88rem;
}

.compact-card img {
  max-height: 40px;
}

/* Quitamos espacio inferior innecesario al eliminar el footer */
.footer {
  display: none !important;
}

/* Responsive */
@media (max-width: 980px) {
  .header-v3 {
    grid-template-columns: auto 1fr;
  }

  .header-contact {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .header-v3 {
    display: block;
  }

  .logo-dismadel {
    max-height: 70px;
    margin-bottom: 8px;
  }

  .header-contact {
    margin-top: 10px;
  }

  .lotes-actions {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .lotes-actions .button {
    flex: 0 0 auto;
  }
}


/* AJUSTES VISUALES V4 */

/* Ya no usamos el aviso amarillo de revisión interna */
.notice {
  display: none !important;
}

/* Mejora visual al pasar por encima de los lotes */
.lotes-actions .button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 7px rgba(0,0,0,.18);
}

.lotes-actions .button {
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}


/* AJUSTES V3 - COMPACTAR BUSCADORES Y TARIFA EN LÍNEA */

.search-box {
  padding-top: 12px;
  padding-bottom: 12px;
  margin-top: 14px;
  margin-bottom: 14px;
}

.search-box h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.search-box label {
  margin-bottom: 4px;
}

.search-box input {
  padding-top: 10px;
  padding-bottom: 10px;
}

.filters {
  margin-top: 8px;
  gap: 8px;
}

.filters label {
  margin-bottom: 4px;
}

.filters select {
  padding-top: 9px;
  padding-bottom: 9px;
}

.results-info {
  margin-top: 8px;
  margin-bottom: 8px;
}

.tarifa-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
  margin-bottom: 12px;
}

.tarifa-inline h2 {
  margin: 0;
}

.tarifa-inline .actions {
  margin: 0;
}

.info-box strong {
  font-weight: 700;
}


/* PARCHE CACHE V5 - CONTROL LIMPIO DE CABECERA Y LOGO */

.header {
  display: flex;
  align-items: center;
  gap: 22px;
}

.header img {
  width: auto;
  height: auto;
  max-width: 260px;
  max-height: 90px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.header-title h1 {
  line-height: 1.15;
}

.header-title h1 span {
  display: inline-block;
  margin-top: 4px;
}

@media (max-width: 760px) {
  .header {
    display: block;
  }

  .header img {
    max-width: 230px;
    max-height: 85px;
    margin-bottom: 12px;
  }
}


/* PARCHE CABECERA V6 - AJUSTE CAJA CONTACTO SUPERIOR */

.header {
  display: grid !important;
  grid-template-columns: auto minmax(260px, 1fr) minmax(360px, 520px) !important;
  align-items: center !important;
  gap: 22px !important;
}

.header .footer {
  max-width: 520px !important;
  width: 100% !important;
  margin-top: 0 !important;
  justify-self: end !important;
  line-height: 1.35 !important;
}

.header .footer p.small {
  max-width: 480px !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  margin-top: 8px !important;
}

.header-title {
  min-width: 260px !important;
}

.header-title h1 {
  margin-bottom: 6px !important;
}

@media (max-width: 1100px) {
  .header {
    grid-template-columns: auto 1fr !important;
  }

  .header .footer {
    grid-column: 1 / -1 !important;
    justify-self: stretch !important;
    max-width: none !important;
    margin-top: 8px !important;
  }

  .header .footer p.small {
    max-width: none !important;
  }
}

@media (max-width: 760px) {
  .header {
    display: block !important;
  }

  .header .footer {
    margin-top: 14px !important;
  }
}


/* PARCHE LOGOS CATALOGOS V7 */

.catalog-logo-wrap {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 6px;
}

.compact-card .catalog-logo-wrap img {
  max-width: 120px !important;
  max-height: 44px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
}

.compact-card {
  min-height: 145px !important;
}

.compact-card h3 {
  margin-top: 4px !important;
}


/* PARCHE CONTACTO V8 - RECUPERAR CAJA SUPERIOR DERECHA */

.header {
  display: grid !important;
  grid-template-columns: auto minmax(260px, 1fr) minmax(360px, 520px) !important;
  align-items: center !important;
  gap: 22px !important;
  border-bottom: 1px solid #ddd !important;
  padding-bottom: 18px !important;
  margin-bottom: 18px !important;
}

.contact-top {
  background: #f7f7f7 !important;
  border: 1px solid #ddd !important;
  border-left: 6px solid #c8231a !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
  max-width: 520px !important;
  width: 100% !important;
  justify-self: end !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  color: #222 !important;
}

.contact-top strong {
  font-weight: 700 !important;
}

.contact-top p.small {
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  max-width: 480px !important;
  white-space: normal !important;
  line-height: 1.35 !important;
  color: #444 !important;
}

@media (max-width: 1100px) {
  .header {
    grid-template-columns: auto 1fr !important;
  }

  .contact-top {
    grid-column: 1 / -1 !important;
    justify-self: stretch !important;
    max-width: none !important;
    margin-top: 8px !important;
  }

  .contact-top p.small {
    max-width: none !important;
  }
}

@media (max-width: 760px) {
  .header {
    display: block !important;
  }

  .contact-top {
    margin-top: 14px !important;
  }
}


/* PARCHE TOOLTIPS LOTES V9 */

.tooltip-lote {
  display: none;
  position: fixed;
  z-index: 99999;
  background: #222;
  color: #fff;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 0.92rem;
  line-height: 1.3;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  pointer-events: none;
}

.lotes-actions .button {
  position: relative;
}
.logo-ucm{
    height:70px;
    width:auto;
    object-fit:contain;
    margin-left:10px;
    margin-right:10px;
}
