/* ============================================================
   ProfeAcademī · Gestión Académica (admin) — Soft UI claro
   ============================================================ */

.pa-g-shell { max-width: 1280px; margin: 0 auto; padding: 1.6rem 1rem 4rem; }

.pa-g-card {
  background: var(--inicio-card-bg, #fff);
  border: 1px solid var(--inicio-card-border, rgba(0,0,0,.06));
  border-radius: 20px;
  padding: 1.8rem 2rem;
  box-shadow: 0 18px 50px var(--inicio-shadow, rgba(0,0,0,.08));
  margin-bottom: 1.2rem;
  position: relative;
  overflow: hidden;
}
.pa-g-card::after {
  content: '';
  position: absolute; inset: auto 0 0 0; height: 70px;
  background: linear-gradient(180deg, transparent, rgba(248,113,113,.06));
  pointer-events: none;
  border-radius: 0 0 20px 20px;
}
.pa-g-card > * { position: relative; z-index: 1; }

/* ── Header ── */
.pa-g-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.4rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--inicio-card-border, rgba(0,0,0,.06));
}
.pa-g-title {
  display: flex; align-items: center; gap: .65rem; margin: 0;
  font-size: 1.65rem; font-weight: 700; color: var(--inicio-text-primary, #1f2937);
}
.pa-g-title .icon { font-size: 1.95rem; filter: drop-shadow(0 4px 8px rgba(248,113,113,.35)); }
.pa-g-controls { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }

.pa-g-select, .pa-g-input {
  background: white; color: var(--inicio-text-primary, #1f2937);
  border: 1.5px solid var(--inicio-card-border, rgba(0,0,0,.12));
  border-radius: 10px; padding: .55rem .85rem;
  font-size: .88rem; font-weight: 500; cursor: pointer;
}
.pa-g-select:focus, .pa-g-input:focus {
  outline: none; border-color: var(--inicio-primary, #4f46e5); box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.pa-g-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .58rem 1.15rem; background: var(--inicio-primary, #4f46e5);
  color: white; border: 0; border-radius: 10px;
  font-size: .88rem; font-weight: 600; cursor: pointer;
  transition: transform .15s, box-shadow .2s, filter .2s;
  box-shadow: 0 4px 12px rgba(79,70,229,.25);
  text-decoration: none;
}
.pa-g-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79,70,229,.35); filter: brightness(1.05); }
.pa-g-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.pa-g-btn-ghost { background: transparent; color: var(--inicio-text-secondary, #6b7280); border: 1px solid var(--inicio-card-border, rgba(0,0,0,.1)); box-shadow: none; }
.pa-g-btn-ghost:hover { background: rgba(99,179,237,.08); color: var(--inicio-primary, #4f46e5); box-shadow: none; }
.pa-g-btn-success { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 12px rgba(16,185,129,.3); }
.pa-g-btn-danger  { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 4px 12px rgba(239,68,68,.3); }
.pa-g-btn-sm { padding: .42rem .85rem; font-size: .8rem; }
.pa-g-btn-icon { padding: .4rem .7rem; font-size: .85rem; }

/* ── Tabs ── */
.pa-g-tabs {
  display: flex; gap: .4rem;
  border-bottom: 2px solid var(--inicio-card-border, rgba(0,0,0,.06));
  margin-bottom: 1.4rem; flex-wrap: wrap;
}
.pa-g-tab {
  padding: .7rem 1.2rem; background: transparent; border: 0;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  color: var(--inicio-text-secondary, #6b7280);
  font-size: .92rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4rem;
  border-radius: 8px 8px 0 0;
  transition: color .2s, background .2s, border-color .2s;
}
.pa-g-tab:hover { color: var(--inicio-primary, #4f46e5); background: rgba(99,179,237,.06); }
.pa-g-tab.active { color: var(--inicio-primary, #4f46e5); border-bottom-color: var(--inicio-primary, #4f46e5); }

/* ── Tabla ── */
.pa-g-table {
  width: 100%; border-collapse: separate; border-spacing: 0 .45rem; font-size: .9rem;
}
.pa-g-table thead th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .8px;
  color: var(--inicio-text-secondary, #6b7280); padding: .5rem .9rem; font-weight: 700;
}
.pa-g-table tbody tr { background: white; transition: transform .15s, box-shadow .15s; }
.pa-g-table tbody tr:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.pa-g-table tbody td {
  padding: .85rem .9rem; color: var(--inicio-text-primary, #1f2937);
  border-top: 1px solid var(--inicio-card-border, rgba(0,0,0,.06));
  border-bottom: 1px solid var(--inicio-card-border, rgba(0,0,0,.06));
  background: white;
}
.pa-g-table tbody td:first-child { border-left: 1px solid var(--inicio-card-border, rgba(0,0,0,.06)); border-radius: 12px 0 0 12px; }
.pa-g-table tbody td:last-child  { border-right: 1px solid var(--inicio-card-border, rgba(0,0,0,.06)); border-radius: 0 12px 12px 0; }
.pa-g-actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* Badge para nivel/rol */
.pa-g-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.pa-g-badge.nivel-Basica    { background: rgba(99,179,237,.18); color: #1d4ed8; border: 1px solid rgba(99,179,237,.4); }
.pa-g-badge.nivel-Media     { background: rgba(167,139,250,.18); color: #6d28d9; border: 1px solid rgba(167,139,250,.4); }
.pa-g-badge.nivel-Prebasica { background: rgba(251,191,36,.18); color: #92400e; border: 1px solid rgba(251,191,36,.4); }
.pa-g-badge.es-jefe         { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; box-shadow: 0 2px 4px rgba(245,158,11,.3); border: 0; }

.pa-g-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; padding: 2px 9px;
  background: rgba(167,139,250,.15);
  color: #6d28d9; font-weight: 700; font-size: .8rem;
  border-radius: 9px;
}

/* ── Modal ── */
.pa-g-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 8000; padding: 1rem;
}
.pa-g-modal.open { display: flex; }
.pa-g-modal-card {
  background: white; border-radius: 18px;
  padding: 1.8rem;
  width: 100%; max-width: 480px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
  position: relative;
  max-height: 90vh; overflow-y: auto;
}
.pa-g-modal-card h3 {
  margin: 0 0 1.2rem; font-size: 1.2rem;
  color: var(--inicio-text-primary, #1f2937);
  display: flex; align-items: center; gap: .5rem;
}
.pa-g-field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.pa-g-field label { font-size: .82rem; font-weight: 600; color: var(--inicio-text-secondary, #6b7280); }
.pa-g-field input,
.pa-g-field select,
.pa-g-field textarea {
  width: 100%; padding: .55rem .85rem; border-radius: 10px;
  border: 1.5px solid var(--inicio-card-border, rgba(0,0,0,.12));
  font-size: .9rem; background: white; color: var(--inicio-text-primary, #1f2937);
  box-sizing: border-box; font-family: inherit;
}
.pa-g-field input:focus, .pa-g-field select:focus, .pa-g-field textarea:focus {
  outline: none; border-color: var(--inicio-primary, #4f46e5); box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.pa-g-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.pa-g-modal-actions {
  display: flex; gap: .6rem; justify-content: flex-end; margin-top: .8rem;
  padding-top: .8rem; border-top: 1px solid var(--inicio-card-border, rgba(0,0,0,.06));
}
.pa-g-modal-close {
  position: absolute; top: .8rem; right: .8rem;
  background: transparent; border: 0; font-size: 1.4rem; color: #9ca3af; cursor: pointer; line-height: 1;
}
.pa-g-modal-close:hover { color: #1f2937; }

.pa-g-warn {
  margin-top: .5rem; padding: .65rem .85rem;
  background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.35);
  color: #92400e; border-radius: 10px; font-size: .82rem; line-height: 1.45;
}

/* ── Multi-select de cursos (asignación masiva) ── */
.pa-g-multi {
  border: 1.5px solid var(--inicio-card-border, rgba(0,0,0,.1));
  border-radius: 12px;
  padding: .9rem 1rem;
  max-height: 320px;
  overflow-y: auto;
  background: #fafafa;
}
.pa-g-multi-section { margin-bottom: 1rem; }
.pa-g-multi-section:last-child { margin-bottom: 0; }
.pa-g-multi-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .5rem; padding-bottom: .35rem;
  border-bottom: 1px dashed rgba(0,0,0,.1);
}
.pa-g-multi-section-head .ttl {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--inicio-text-secondary, #6b7280);
}
.pa-g-multi-section-head button {
  background: transparent; border: 0; color: var(--inicio-primary, #4f46e5);
  font-size: .75rem; font-weight: 600; cursor: pointer;
  padding: 2px 8px; border-radius: 6px;
}
.pa-g-multi-section-head button:hover { background: rgba(79,70,229,.1); }

.pa-g-multi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .35rem;
}
.pa-g-check-item {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .55rem;
  background: white;
  border: 1px solid var(--inicio-card-border, rgba(0,0,0,.07));
  border-radius: 8px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--inicio-text-primary, #1f2937);
  transition: background .15s, border-color .15s, transform .12s;
  user-select: none;
}
.pa-g-check-item:hover { background: rgba(79,70,229,.05); border-color: rgba(79,70,229,.3); transform: translateY(-1px); }
.pa-g-check-item.checked { background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(167,139,250,.1)); border-color: rgba(79,70,229,.4); font-weight: 600; }
.pa-g-check-item.disabled {
  opacity: .55; cursor: not-allowed;
  background: rgba(16,185,129,.06);
  border-color: rgba(16,185,129,.3);
  color: #047857;
}
.pa-g-check-item input { margin: 0; cursor: pointer; }
.pa-g-check-item.disabled input { cursor: not-allowed; }
.pa-g-check-item .lbl { flex: 1; line-height: 1.1; }
.pa-g-check-item .hint { font-size: .65rem; color: #047857; font-weight: 600; }

.pa-g-multi-summary {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: .8rem;
  padding: .55rem .8rem;
  background: linear-gradient(135deg, rgba(99,179,237,.08), rgba(167,139,250,.08));
  border: 1px solid rgba(79,70,229,.2);
  border-radius: 10px;
  font-size: .85rem; color: var(--inicio-text-primary, #1f2937);
}
.pa-g-multi-summary strong { color: var(--inicio-primary, #4f46e5); font-size: 1rem; }

/* ── Empty ── */
.pa-g-empty { text-align: center; padding: 2.5rem 1rem; color: var(--inicio-text-secondary, #6b7280); font-size: .92rem; }
.pa-g-empty .ic { font-size: 2.6rem; margin-bottom: .5rem; }

/* ── Toast ── */
.pa-g-toast-container { position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: .55rem; pointer-events: none; max-width: 95vw; }
.pa-g-toast {
  pointer-events: auto; padding: .85rem 1.4rem; border-radius: 12px;
  background: white; border: 1px solid rgba(0,0,0,.08);
  border-left: 4px solid var(--inicio-primary, #4f46e5);
  color: #1f2937; font-size: .9rem; font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  max-width: 420px; animation: paGToastIn .25s ease;
}
.pa-g-toast.success { border-left-color: #10b981; }
.pa-g-toast.error   { border-left-color: #ef4444; }
.pa-g-toast.info    { border-left-color: #4f46e5; }
@keyframes paGToastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 640px) {
  .pa-g-card { padding: 1.4rem 1rem; }
  .pa-g-table thead { display: none; }
  .pa-g-table tbody td { display: block; padding: .35rem .9rem; border: 0; background: transparent; }
  .pa-g-table tbody tr {
    display: block;
    padding: .8rem;
    margin-bottom: .55rem;
    border-radius: 12px;
    border: 1px solid var(--inicio-card-border, rgba(0,0,0,.08));
  }
  .pa-g-field-row { grid-template-columns: 1fr; }
}
