/* ===== Tokens de tema (light corporativo) ===== */
:root{
  --brand:#2563eb;         /* azul logo */
  --brand-strong:#1e40af;  /* azul profundo */
  --accent:#f59e0b;        /* naranja logo */
  --text:#0f172a;
  --muted:#64748b;
  --bg:#f7f9fc;
  --surface:#ffffff;
  --border:#e6e8f0;
  --radius:12px;
  --shadow:0 8px 24px rgba(2,6,23,.06);
  --ring:59 130 246;
}

/* ===== Base ===== */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; padding:28px; color:var(--text);
  font-family:Inter,"Segoe UI",system-ui,-apple-system,sans-serif;
  background:
    radial-gradient(900px 500px at 120% -10%, #eef3ff 0%, transparent 60%),
    radial-gradient(1100px 600px at -10% -20%, #edf2fe 0%, transparent 60%),
    var(--bg);
}
.container{max-width:1280px;margin:auto}

/* ===== Header ===== */
.header{
  display:flex; 
  flex-wrap:wrap; 
  align-items:center; 
  justify-content:center;
  gap:18px; 
  text-align:center;
  background:var(--surface); 
  padding:16px 22px; 
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.logo-img{
  max-height:56px;
  width:auto
}
.title {
  margin:0; 
  font-size:2rem; 
  font-weight:800; 
  color:var(--brand-strong)}

/* Títulos de página */
h1{
  font-size:1.5rem; 
  margin:14px 0 18px; 
  color:var(--brand-strong)
}
h2{
  font-size:1.5rem; 
  margin:18px 0 8px
}

/* ===== Buscador ===== */
.search-form{
  display:flex; 
  gap:12px; 
  flex-wrap:wrap; 
  margin:18px 0 24px
}
.search-form label{font-weight:600; 
  color:var(--muted); 
  align-self:center}
.search-form input[type="text"],
.search-form input[type="date"]{
  flex:1; min-width:240px; padding:12px 14px; font-size:2rem;
  background:#fff; border:1px solid var(--border); border-radius:10px;
  transition:border-color .15s, box-shadow .15s;
}
.search-form input:focus{
  outline:none; border-color:rgba(var(--ring)/.6);
  box-shadow:0 0 0 4px rgba(var(--ring)/.25);
}

/* Botón primario (Buscar) */
.search-form button{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 18px; font-weight:700; border:0; border-radius:10px; color:#fff;
  background:linear-gradient(135deg, var(--brand), #1d4ed8);
  box-shadow:0 6px 14px rgba(37,99,235,.24);
  cursor:pointer; transition:transform .15s, box-shadow .15s, filter .15s;
}
.search-form button:hover{ transform:translateY(-1px); filter:saturate(1.05) }
.search-form button:focus-visible{ outline:none; box-shadow:0 0 0 4px rgba(var(--ring)/.35) }

/* Botón secundario (Limpiar) */
.reset-button{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 18px; font-weight:700; border-radius:10px; text-decoration:none;
  color:var(--brand); background:#f1f5ff; border:1px solid #c7d2fe;
}
.reset-button:hover{ background:#e7efff }

/* Cabecera de resultados */
.results-header{
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
  gap:12px; flex-wrap:wrap;
  background:var(--surface); 
  border:1px solid var(--border);
  padding:14px 16px; 
  border-radius:10px; 
  box-shadow:var(--shadow);
  margin:6px 0 12px;
}
.results-header em{ color:var(--brand); font-style:normal }
.results-header strong{ color:var(--brand-strong) }

/* ===== Tabla (estilo visualtablas) ===== */
.table-scroll{
  overflow-x:auto;
  overflow-y:auto;
  max-height: 600px;
}
.top-scroll-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 4px;
}
.top-scroll-wrapper::-webkit-scrollbar {
  height: 12px;
}
.top-scroll-content {
  height: 1px;
}
table{
  width:100%; border-collapse:separate; border-spacing:0; background:var(--surface);
  border:1px solid var(--border); border-radius:12px; overflow:hidden; box-shadow:var(--shadow);
}
thead{
  background:#f8faff; color:#111827;
}
thead th{
  padding:14px 12px; 
  border-bottom:1px solid var(--border);
  font-weight:700;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8faff;
  box-shadow: 0 1px 0 var(--border);
}
tbody td{
  padding:14px 12px; border-bottom:1px solid var(--border);
}
tbody tr:nth-child(even){ background:#fbfcff }
tbody tr:hover{ background:#f5f7ff }

/* chips/enlaces dentro de celdas (ej. Ver imagen) */
a{ color:var(--brand); text-decoration:none; font-weight:600 }
a:hover{ text-decoration:underline }
td a[target="_blank"]{
  display:inline-block; padding:6px 10px; border-radius:999px;
  background:#eef2ff; border:1px solid #dbe3ff; text-decoration:none;
}
td a[target="_blank"]:hover{ background:#e0e7ff }

/* ===== Paginación ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  min-width: 38px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.page-link:hover:not(.disabled):not(.active) {
  background: #f1f5ff;
  border-color: #c7d2fe;
  color: var(--brand);
}
.page-link.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}
.page-link.disabled {
  color: var(--muted);
  background: #f8f9fa;
  cursor: not-allowed;
  opacity: 0.6;
}
.page-ellipsis {
  color: var(--muted);
  font-weight: 600;
  padding: 0 4px;
}
td a[target="_blank"]{
  display:inline-block; padding:6px 10px; border-radius:999px;
  background:#eef2ff; border:1px solid #dbe3ff; text-decoration:none;
}
td a[target="_blank"]:hover{ background:#e0e7ff }

/* Alertas */
.alert{
  background:#fee2e2; color:#b91c1c; border:1px solid #fecaca;
  padding:12px 14px; border-radius:10px;
}

/* ===== Responsive ===== */
@media (max-width:780px){
  body{ padding:16px }
  .title{ font-size:1.6rem }
  .search-form{ flex-direction:column }
  .search-form input,.search-form button,.reset-button{ width:100% }
  table{ font-size:.92rem } thead th, tbody td{ padding:10px }
}
