/* =================================================================
   admin.css — Estilos compartidos del panel administrativo
   I.E.S. Nº 8 · Sagrado Corazón FASTA
   Incluir DESPUÉS de style.css en cada página del panel.
   ================================================================= */

/* ── WRAPPER PRINCIPAL ────────────────────────────────────────── */
html, body { height: 100%; }

.admin-wrap {
  max-width: 1400px; margin: 0 auto;
  padding: 1px;
  /* FIX: el wrap debe ocupar toda la altura disponible bajo el topbar
     para que tabla-card pueda usar height:calc(100vh - 62px) */
  height: calc(100vh - 100px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.page-wrap {
  max-width: 1300px; margin: 0 auto; padding: 5px 24px;
}

/* ── HEADER CARD ──────────────────────────────────────────────── */
.admin-header {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.admin-header-left {
  display: flex; align-items: center; gap: 12px;
}
.admin-header-ico {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem;
}
.admin-header-titulo { font-size: 1rem; font-weight: 800; color: var(--primary); }
.admin-header-sub    { font-size: .72rem; color: var(--text2); margin-top: 2px; }

/* ── FILTROS ──────────────────────────────────────────────────── */
.filtros-card {
  background:transparent;
  xborder: 1.5px solid var(--border);
  border-radius: 12px;
  xpadding: 14px 18px;
  padding: 0px;
  xmargin-bottom: 16px;
  margin-bottom: 5px;
  xbox-shadow: var(--shadow);
}
.filtros-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding:2px;
}
.filtro-item {
  display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 160px;
}
.filtro-label {
  font-size: .68rem; xfont-weight: 800; color: var(--text2);
  text-transform: uppercase; letter-spacing: .04em;
}
.filtro-input {
  padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .82rem; color: var(--text);
  font-family: 'Mulish', sans-serif;
  outline: none; background: #fff;
  transition: border-color .18s, box-shadow .18s;
  width: 100%; box-sizing: border-box;
}
.filtro-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(46,109,164,.1);
}
.filtro-input:disabled { background: var(--soft); color: var(--text2); cursor: not-allowed; }
.filtro-input.input-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(192,57,43,.1) !important;
}

/* ── BOTONES COMUNES ──────────────────────────────────────────── */
.btn-buscar {
  padding: 8px 18px; border-radius: 8px;
  background: var(--primary); color: #fff;
  border: none; font-weight: 700; font-size: .82rem;
  font-family: 'Mulish', sans-serif; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all .18s; white-space: nowrap;
}
.btn-buscar:hover { background: var(--secondary); }

.btn-nuevo {
  padding: 8px 18px; border-radius: 8px;
  background: var(--green); color: #fff;
  border: none; font-weight: 700; font-size: .82rem;
  font-family: 'Mulish', sans-serif; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all .18s; white-space: nowrap;
}
.btn-nuevo:hover    { background: #157a4a; }
.btn-nuevo:disabled { background: #aaa; cursor: not-allowed; }

.btn-accion {
  xwidth: 40px; xheight: 40px; border-radius: 5px;
  border: 0px solid var(--border); background: transparent;
  color: var(--text2); cursor: pointer; font-size: 1.00rem;
  display: inline-flex; align-items: center; justify-content: center;
  color: #2a5298;
  transition: all .18s;
    padding: 6px 12px;
}
.btn-accion:hover              { transform: translateY(-1px); }
.btn-accion-edit:hover         { background: rgb(46, 109, 164);    border-color: #fff; color: #fff; }
.btn-accion-del:hover,
.btn-accion-eliminar:hover     { background: var(--red);       border-color: #fff; color: #fff; }
.btn-accion-alumnos:hover,
.btn-accion-perfiles:hover     { background: var(--secondary); border-color: #fff; color: #fff; }
.btn-accion-print:hover        { background: #6040b0;          border-color: #fff; color: #fff; }

/* ── TABLA CARD ───────────────────────────────────────────────── */
.tabla-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  xbox-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  /* FIX: flex:1 para que ocupe el espacio restante dentro de admin-wrap */
  flex: 1;
  min-height: 0;
}

.tabla-header {
  padding: 2px 2px 2px 10px;
  border-bottom: 1.5px solid var(--border);
  background: var(--soft);
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.tabla-titulo {
  font-size: .8rem; font-weight: 800; color: var(--primary);
  display: flex; align-items: center; gap: 7px;
}
.tabla-wrap  { overflow-x: auto; overflow-y: auto; flex: 1; min-height: 0; }
.tabla-info  {
  font-size: .9rem; color: black;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 10px;
  background: rgba(180, 206, 232,0.6) ;
}
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--primary); color: #fff;
  padding: 9px 13px; font-size: .68rem; font-weight: 700;
  text-align: left; white-space: nowrap;
}
tbody tr { border-bottom: 0px solid var(--border); transition: background .13s; }
tbody tr:hover { background: #f0f6fc; }
tbody td { padding: 9px 13px; font-size: .8rem; vertical-align: middle; }

/* ── TABLA VACÍA ──────────────────────────────────────────────── */
.tabla-vacia {
  padding: 40px 20px; text-align: center;
}
.tabla-vacia-titulo {
  font-size: .9rem; font-weight: 700; color: var(--text2); margin-bottom: 4px;
}
.tabla-vacia i { font-size: 2rem; color: var(--border); display: block; margin-bottom: 10px; }
.tabla-vacia p { font-size: .78rem; color: var(--text2); margin: 0; }

/* ── BADGE / NÚMERO ───────────────────────────────────────────── */
.badge-num {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--secondary); color: #fff;
  font-size: .65rem; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px;
}

/* ── OVERLAY DE ESPERA ────────────────────────────────────────── */
#overlayWait {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(20, 40, 70, .55);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
}
#overlayWait.show { display: flex; }
.spin-circle {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  animation: spinCircle .7s linear infinite;
}
.overlay-msg {
  color: #fff; font-size: .88rem; font-weight: 700;
  letter-spacing: .02em;
}
@keyframes spinCircle { to { transform: rotate(360deg); } }

/* ── TOAST ────────────────────────────────────────────────────── */
.toast-wrap.toast-error { background: var(--red); }

/* ── MODAL CONFIRMAR ELIMINAR ─────────────────────────────────── */
.modal-confirm-icon  { font-size: 2rem; margin-bottom: 8px; }
.modal-confirm-titulo { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.modal-confirm-msg   { font-size: .82rem; color: var(--text2); margin-bottom: 18px; }

.btn-modal-ok {
  background: var(--red); color: #fff; border: none;
  border-radius: 8px; font-weight: 700; font-size: .85rem; padding: 8px 12px;
  cursor: pointer; font-family: 'Mulish', sans-serif;
}
.btn-modal-ok:hover { background: #a93226; }

/* ── PAGINACIÓN ───────────────────────────────────────────────── */
.pag-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; padding: 12px 16px;
  border-top: 1.5px solid var(--border);
}
.pag-btn {
  min-width: 32px; height: 32px; border-radius: 7px;
  border: 1.5px solid var(--border); background: #fff;
  color: var(--text2); cursor: pointer; font-size: .78rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Mulish', sans-serif; transition: all .15s;
}
.pag-btn:hover       { border-color: var(--secondary); color: var(--secondary); }
.pag-btn.active      { background: var(--primary); border-color: var(--primary); color: #fff; }
.pag-btn:disabled    { opacity: .4; cursor: not-allowed; }

/* ── SEARCH BAR ───────────────────────────────────────────────── */
#searchWrap {
  display: none; margin-bottom: 10px;
}
#searchWrap.visible { display: block; }
#busqTabla {
  width: 100%; padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .82rem; font-family: 'Mulish', sans-serif;
  outline: none; transition: border-color .18s;
}
#busqTabla:focus { border-color: var(--secondary); }
.search-wrap-inner { position: relative; }
.search-wrap-inner i {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); color: var(--text2); font-size: .85rem;
  pointer-events: none;
}

/* ── ANIMACIONES COMUNES ──────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-fadein { animation: fadeIn .22s ease both; }

/* ── RESPONSIVE COMÚN ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .admin-wrap,
  .page-wrap         { padding: 12px 14px; }
  .admin-header      { flex-direction: column; align-items: stretch; }
  .filtros-row       { flex-direction: column; gap: 8px; }
  .filtro-item       { width: 100%; max-width: 100%; }
  .btn-nuevo         { align-self: center; }
  thead th:nth-child(n+5) { display: none; }
  tbody td:nth-child(n+5) { display: none; }
}

/* FIX mobile: admin-wrap no necesita altura fija en mobile */
@media (max-width: 768px) {
  .admin-wrap {
 
    xmin-height: calc(100vh - 62px);
    height: calc(100dvh - 430px);
  }
}
