/* =======================================================================
   EMBA UI — estilos unificados (Bootstrap 5 + DataTables)
   ======================================================================= */

/* ===== Base / Utilidades ===== */
body { padding: 20px; }
.page-hero h1 { letter-spacing:.2px; }
.hint, .form-text.hint { color:#6c757d; font-size:.825rem; }
.select-ghost option[disabled] { color:#999; }
.info-line { font-size:.95rem; color:#495057; }
body.public-page { background:#f7f8fb; }

.card, .modal-content { border-radius: 16px; }
.page-hero{
  background: linear-gradient(135deg, #0d6efd10, #0d6efd20);
  border-radius: 16px; padding: 1rem 1.25rem;
}

/* ===== Botones ===== */
.btn-gradient{ background: linear-gradient(180deg, var(--bs-primary) 0%, #0b5ed7 100%); color:#fff; border:0; }
.btn-gradient:hover{ filter: brightness(.95); }
.btn-rounded { border-radius: 50rem; }
.badge .btn{ line-height:1; padding:.1rem .25rem; }

/* ===== Inputs ===== */
.form-control, .form-select{
  transition: border-color .15s ease, box-shadow .15s ease;
}

/* =======================================================================
   Tablas (Admin) + DataTables
   ======================================================================= */

/* Zebra + homogeneidad */
.table-striped > tbody > tr:nth-of-type(odd){
  --bs-table-accent-bg: rgba(0,0,0,.015);
  background-color: var(--bs-table-accent-bg);
}
.rounded-table{ border-radius:.75rem; overflow:hidden; }
.table th, .table td{ vertical-align: middle; }

/* ===== Toolbar común: buscar IZQ / acciones DER ===== */
.dt-toolbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:.75rem; margin-bottom:.75rem;
}
.dt-toolbar .dt-left, .dt-toolbar .dt-right{
  display:flex; align-items:center; gap:.5rem;
}
.dt-toolbar .dt-left{ flex:1; }

/* Filtro DataTables con el mismo look en TODAS */
.dataTables_wrapper .dataTables_filter{ margin:0; }
.dataTables_wrapper .dataTables_filter label{
  display:flex; align-items:center; gap:.5rem; margin:0;
}
.dataTables_wrapper .dataTables_filter input[type="search"]{
  max-width: 320px;                 /* tamaño chico, parejo */
  height: 31px;                     /* ~ form-control-sm */
  padding: .25rem .5rem;
  border-radius: 10px;
}

/* Audiciones (no DT) – buscador con el mismo look */
#aud-headbar input[type="search"]{
  max-width: 320px; height:31px; padding:.25rem .5rem; border-radius:10px;
}

/* ===== DataTables: layout y contención ===== */
.dataTables_wrapper table.dataTable{
  width:100% !important;
  table-layout: fixed;              /* respeta contenedor + elipsis si se usa */
}
.dataTables_wrapper .table-responsive{ overflow-x:auto; }

/* Utilidades para control de wrapping */
.dt-wrap     { white-space: normal !important; word-break: break-word; }
.dt-nowrap   { white-space: nowrap  !important; }
.dt-ellipsis { white-space: nowrap  !important; overflow: hidden; text-overflow: ellipsis; }

/* Truncado genérico (si lo necesitás por columna) */
td.dt-truncate{
  max-width: 360px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
@media (max-width: 992px){
  td.dt-truncate{ max-width:220px; }
}

/* ===== Alturas cómodas y headers centrados (con salto) ===== */
:root{
  --dt-head-min-h: 56px;   /* alto base de cabecera */
  --dt-row-h:       60px;   /* alto base de filas */
}

/* Cabeceras centradas y con salto permitido */
.dataTables_wrapper table.dataTable thead th,
.dataTables_wrapper table.dataTable tfoot th,
table.dataTable thead th,
table.dataTable>thead>tr>th{
  text-align:center !important;
  vertical-align:middle !important;
  min-height: var(--dt-head-min-h);
  padding-top:.9rem !important;
  padding-bottom:.9rem !important;
  line-height:1.2;
  white-space: normal !important;    /* <— permite 2 líneas */
  word-break: break-word;            /* evita solapados */
  overflow-wrap: anywhere;
}

/* Ajuste del caret de orden para que no “coma” texto */
.dataTables_wrapper table.dataTable thead th.sorting,
.dataTables_wrapper table.dataTable thead th.sorting_asc,
.dataTables_wrapper table.dataTable thead th.sorting_desc{
  padding-right: 1.25rem;
  background-position: right .5rem center;
  background-repeat: no-repeat;
}

/* Filas del body: altura por padding (sin altura fija) */
.dataTables_wrapper table.dataTable tbody tr{
  min-height: var(--dt-row-h);      /* <— permite crecer si el contenido ocupa más */
}
.dataTables_wrapper table.dataTable tbody td{
  padding-top:.8rem !important;
  padding-bottom:.8rem !important;
  vertical-align: middle;
}

/* ===== Cursor “mano” en tablas clickeables ===== */
.table.table-hover.table-clickable tbody tr,
.dataTables_wrapper table.table-clickable tbody tr{
  cursor: pointer !important;
}
.table.table-hover tbody tr{ cursor: default; } /* solo las NO clickeables */
.table-clickable tbody tr:hover{ background: rgba(13,110,253,.06); }

/* ===== Audiciones: headers centrados y altura de filas ===== */
#tablaAudiciones thead th{ text-align:center !important; vertical-align:middle !important; }
#tablaAudiciones tbody tr{ min-height:56px; }

/* Unificar buscador en Audiciones como DataTables */
#aud-headbar .dataTables_filter label {
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
  margin-bottom: 0;
}
#aud-headbar .dataTables_filter input.form-control {
  display: inline-block;
  width: 14rem;      /* similar al default de DT */
  max-width: 100%;
}

/* Columnas de estados (Sí/No) más angostas */
#tablaPersonasInsc td.text-center.align-middle,
#tablaMatriculados td.text-center.align-middle {
  width: 1%;
  white-space: nowrap;
}

/* ===== Cursor “mano” en tablas clickeables ===== */
.table.table-hover.table-clickable tbody tr,
.dataTables_wrapper table.table-clickable tbody tr {
  cursor: pointer !important;
}
.table.table-hover tbody tr {
  cursor: default;
}
.table-clickable tbody tr:hover {
  background: rgba(13, 110, 253, 0.06);
}

/* ===== Audiciones: headers centrados y altura de filas ===== */
#tablaAudiciones thead th {
  text-align: center !important;
  vertical-align: middle !important;
}
#tablaAudiciones tbody tr {
  min-height: 56px;
}

/* Unificar buscador en Audiciones como DataTables */
#aud-headbar .dataTables_filter label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  margin-bottom: 0;
}
#aud-headbar .dataTables_filter input.form-control {
  display: inline-block;
  width: 14rem;
  max-width: 100%;
}