:root {
  --bg: #ffffff;
  --fg: #0f172a; /* slate-900 */
  --muted: #475569; /* slate-600 */
  --border: #e2e8f0; /* slate-200 */
  --head: #800000; /* slate-50 */
  --radius: 14px;
}

.table-wrap {
  max-width: 1100px;
  margin-inline: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(2, 6, 23, 0.05);
  overflow: hidden;
}

/* ===== Tabla de escritorio ===== */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 16px;
}
thead th {
  text-align: center;
  background: var(--head);
  padding: 16px 18px;
  font-weight: 800;
  color: white;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 18px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
tbody tr:last-child td {
  border-bottom: none;
}

/* Estética extra */
tbody tr:nth-child(even) {
  background: #ececec;
}
.inst {
  font-weight: 800;
}
.nombre {
  font-weight: 600;
}
.perfil strong {
  font-weight: 900;
}
.muted {
  color: var(--muted);
}

/* Asegura scroll horizontal si hace falta (entre md y lg) */
.scroll-x {
  overflow-x: auto;
}

/* ===== Modo "cards" para móviles ===== */
@media (max-width: 720px) {
  thead {
    display: none;
  }
  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }
  tbody tr {
    border-top: 1px solid var(--border);
    padding: 14px 14px 6px;
  }
  tbody tr:first-child {
    border-top: none;
  }
  tbody td {
    border: none;
    padding: 8px 6px 8px 120px; /* deja espacio para la etiqueta */
    position: relative;
    min-height: 44px;
  }
  tbody td::before {
    content: attr(data-label);
    position: absolute;
    left: 12px;
    top: 8px;
    width: 100px;
    font-weight: 800;
    color: var(--muted);
    text-transform: none;
  }
  .table-wrap {
    border-radius: 12px;
  }
}

/* Impresión sobria */
@media print {
  body {
    padding: 0;
  }
  .table-wrap {
    border: none;
    box-shadow: none;
  }
  tbody tr:nth-child(even) {
    background: #fff;
  }
}
