/* ===============================
   HEMATOTRIALS — admin.css (limpio)
   =============================== */

:root{
  --idr-primary:#93120e;
  --idr-border:#dcdde1;
  --idr-text:#111;
  --idr-muted:#6b7280;
}

/* ===== Contenedor general ===== */
.idralev-buscador{
  background:#f3f3f3;
  padding:10px;
  border-radius:10px;
}
.idralev-buscador .notice.notice-warning{
  background:#fffbe6;
  border:1px solid #f59e0b;
  color:#7c5200;
  border-radius:8px;
}

/* ===== Layout sin sidebar ===== */
.idralev-buscador .idr-layout.no-sidebar{
  display:block !important;
  grid-template-columns:1fr !important;
  gap:0 !important;
}
.idralev-buscador .idr-main{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:32px;
}

/* ===== Botones ===== */
.idralev-buscador .idr-btn{
  background:var(--idr-primary);
  border:none;
  border-radius:10px;
  color:#fff;
  padding:.55rem .9rem;
}
.idralev-buscador .idr-btn.secondary{
  background:#e5e7eb;
  color:var(--idr-text);
}

/* ===============================
   TILES SUPERIORES (3)
   =============================== */
.idr-tiles{
  display:grid;
  grid-template-columns:repeat(3, minmax(220px,1fr));
  gap:45px;
  align-items:center;
  margin-bottom:10px;
  background:#fff;
  padding:35px;
  border-radius:25px;
  box-shadow:0 1px 8px rgba(0,0,0,.1);
}
.idr-tile{
  display:grid;
  place-items:center;
  gap:10px;
  background:#fff;
  border:1px solid var(--idr-border);
  border-radius:20px;
  padding:32px 0;
  cursor:pointer;
  transition:box-shadow .2s, transform .05s;
  box-shadow:0 1px 8px rgba(0,0,0,.3);
  color:#93120e;
}
.idr-tile i{ font-size:75px; }
.idr-tile span{ font-size:15px; font-family:Inter,system-ui,Arial; }
.idr-tile.active{
  box-shadow:0 0 0 2px var(--idr-primary) inset;
  background:var(--idr-primary)!important;
}
.idr-tile.active i,
.idr-tile.active span{
  color:#fff!important;
}
.idr-tile:active{ transform:scale(.99); }

/* Buscador por palabras (oculto) */
.idr-search-row{ display:none !important; }
.visually-hidden{
  position:absolute !important;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ===============================
   GRILLAS DE SELECCIÓN (categorías / patología / provincias)
   =============================== */
.idr-cards{
  display:grid;
  gap:12px;
  margin:12px 0;
}
.idr-cards.three{ grid-template-columns:repeat(3, 1fr); }
.idr-cards.four { grid-template-columns:repeat(4, 1fr); }
.idr-cards.five { grid-template-columns:repeat(5, 1fr); }

.idr-card-tile{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  min-height:110px;
  background:#fff;
  border:1px solid var(--idr-border);
  border-radius:12px;
  padding:16px;
  cursor:pointer;
  transition:box-shadow .15s, transform .05s, background .15s, color .15s;
  color:#93120e;
}
.idr-card-tile:hover{
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  transform:translateY(-1px);
  background:#93120e;
  color:#fff;
}
.idr-card-title{
  font-weight:600;
  text-align:center;
}
.idr-card-sub{
  color:#ddcfcf;
  font-size:13px;
  margin-top:4px;
}
.idr-card-tile.active{
  box-shadow:0 0 0 2px #93120e inset;
  background:#93120e;
  color:#fff;
}

/* ===============================
   RESULTADOS — WRAP & GRID
   =============================== */
.idralev-buscador .idr-results-wrap{
  background:#fff;
  border:1px solid #93120e;
  border-radius:12px;
  padding:12px;
  margin-top:8px;
}

/* Barra de resultados dentro del wrap */
.idralev-buscador .idr-results-wrap .idr-results-bar{
  background:transparent;
  border:none;
  padding:0 0 10px 0;
  margin:0 0 8px 0;
}

/* Grid principal de ensayos */
.idr-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(260px, 1fr));
  gap:14px;
}

/* Tarjeta de ensayo */
.idr-card.idr-card--grid{
  background:#fff;
  border:1px solid #93120e;
  border-radius:12px;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.idr-card__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:5px;
}
.idr-card__title{
  margin:0;
  font-size:18px;
  line-height:1.25;
  font-weight:700;
}
.idr-card__title a{
  color:#93120e;
  text-decoration:none;
}
.idr-card__title a:hover{ text-decoration:underline; }

.idr-card__subtitle{
  margin:0;
  color:#374151;
  font-size:14px;
}

.idr-card__meta{
  display:flex;
  gap:8px;
}
.idr-tag{
  display:inline-block;
  padding:2px 8px;
  border-radius:6px;
  font-size:12px;
  background:#f3f4f6;
  color:#111;
}

.idr-pill{
  display:inline-block;
  padding:4px 10px;
  border-radius:5px;
  font-size:12px;
  font-weight:600;
}
.idr-pill--soft{
  background:#93120e54;
  color:#93120e;
}

.idr-card__footer{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.idr-card__center{
  color:#6b7280;
  font-size:14px;
}

.idr-card__actions{
  display:flex;
  gap:8px;
}
.idr-card__actions .idr-icon-btn{
  width:36px;
  height:36px;
  border-radius:10px;
  border:1px solid #151515;
  background:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:transform .08s, background .15s, box-shadow .15s;
}
.idr-card__actions .idr-icon-btn:hover{
  background:#f3f3f3;
  transform:translateY(-1px);
}

/* ===============================
   TABLA / LISTADO
   =============================== */
.idralev-buscador .idr-table-wrap{ margin-top:0; }

.idralev-buscador .widefat{
  width:100%;
  border:1px solid #151515;
  border-radius:10px;
  overflow:hidden;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
}
.idralev-buscador .widefat thead th{
  background:#f6f7f8;
  font-weight:700;
  font-family:Inter,system-ui,Arial;
  padding:10px;
}
.idralev-buscador .widefat tbody td{ padding:10px; }
.idralev-buscador .widefat tbody tr{ height:auto; }
.idralev-buscador td:first-child strong{
  color:#93120e;
  font-weight:700;
  font-family:Inter,system-ui,Arial;
}

/* Acciones en tabla */
.idralev-buscador .idr-actions-icons{
  display:flex;
  gap:8px;
  justify-content:flex-end;
}
.idralev-buscador .idr-icon-btn{
  width:38px;
  height:38px;
  border-radius:10px;
  border:1px solid #151515;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  transition:transform .08s, background .15s, box-shadow .15s;
}
.idralev-buscador .idr-icon-btn:hover{
  background:#f3f3f3;
  transform:translateY(-1px);
}
.idralev-buscador .fa-up-right-from-square{ color:#0ea5e9; }
.idralev-buscador .fa-file-pdf{ color:#1f2937; }
.idralev-buscador .fa-whatsapp{ color:#10b981; }

/* ===============================
   PAGINACIÓN
   =============================== */
.idralev-buscador .idr-pagination{
  display:flex;
  gap:8px;
  justify-content:center;
  margin:16px 0 6px;
}
.idralev-buscador .idr-pagination .page-numbers{
  min-width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #151515;
  border-radius:8px;
  text-decoration:none;
  background:#fff;
  color:#111;
  font-family:Inter,system-ui,Arial;
}
.idralev-buscador .idr-pagination .page-numbers.current{
  background:#1d4ed8;
  color:#fff;
  border-color:#1d4ed8;
}
.idralev-buscador .idr-pagination .page-numbers:hover{
  background:#f3f3f3;
}
.idralev-buscador .idr-pagination .page-numbers.disabled{
  opacity:.45;
  pointer-events:none;
}

/* ===============================
   BARRA DE RESULTADOS (top)
   =============================== */
.idr-results-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:#fff;
  border:1px solid var(--idr-border);
  border-radius:10px;
  padding:10px 12px;
  margin-bottom:8px;
}
.idr-results-bar .idr-results-count{ font-weight:600; }

.idr-view-toggle{ display:flex; gap:8px; }
.idr-view-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border:1px solid #151515;
  border-radius:8px;
  background:#fff;
  text-decoration:none;
}
.idr-view-btn.active{
  background:#93120e;
  color:#fff;
  border-color:#93120e;
}

/* ===============================
   RESPONSIVE
   =============================== */

/* 1200: menos columnas en grillas grandes */
@media (max-width:1200px){
  .idr-cards.five{ grid-template-columns:repeat(4,1fr); }
}

/* 992: tiles en una columna, grillas más compactas */
@media (max-width:992px){
  .idr-tiles{ grid-template-columns:1fr; }
  .idr-cards.three{ grid-template-columns:repeat(2,1fr); }
  .idr-cards.four{  grid-template-columns:repeat(2,1fr); }
  .idr-cards.five{  grid-template-columns:repeat(3,1fr); }
  .idr-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

/* 768: ajuste especial tarjetas de resultados en móvil */
@media (max-width:768px){

  /* grid de resultados a una columna */
  .idr-grid{
    grid-template-columns:1fr;
    gap:12px;
  }

  /* bloques internos apilados */
  .idr-card--grid .idr-card__header,
  .idr-card--grid .idr-card__subtitle,
  .idr-card--grid .idr-card__meta,
  .idr-card--grid .idr-card__footer{
    display:block;
    width:100%;
  }

  /* Footer: centro arriba, botones abajo */
  .idr-card__footer{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
  }

  .idr-card__center{ margin-bottom:4px; }

  /* Evitar desbordes horizontales */
  .idr-card__title a,
  .idr-card__subtitle,
  .idr-card__center{
    word-break:break-word;
  }
}

/* 600: todo a una sola columna */
@media (max-width:600px){
  .idr-cards.three,
  .idr-cards.four,
  .idr-cards.five{
    grid-template-columns:1fr;
  }
}

/* =========================================
   LISTA (tabla) -> tarjetas en mobile
   ========================================= */
@media (max-width: 768px) {

  /* La tabla deja de comportarse como tabla */
  .idralev-buscador .widefat{
    display:block;
    border:none;
  }

  .idralev-buscador .widefat thead{
    display:none; /* ocultamos encabezados */
  }

  .idralev-buscador .widefat tbody{
    display:flex;
    flex-direction:column;
    gap:10px;
  }

  /* Cada fila pasa a ser una "card" */
  .idralev-buscador .widefat tr{
    display:flex;
    flex-direction:column;
    border:1px solid #93120e;
    border-radius:10px;
    padding:10px;
    background:#fff;
  }

  .idralev-buscador .widefat td{
    display:block;
    width:100%;
    padding:3px 0;
    white-space:normal;
    word-break:break-word; /* evita desbordes horizontales */
  }

  /* Título arriba, un poco separado */
  .idralev-buscador .widefat td.idr-card__title{
    margin-bottom:4px;
  }

  /* Celda de acciones separada abajo */
  .idralev-buscador .widefat td:last-child{
    margin-top:6px;
  }
}

