/* ============================================================
   components.css — Componentes portados del monolito original
   (docs/legacy/index-original.html), adaptados a las variables
   de base.css. Rediseño: cards elevadas, botones con feedback
   físico, badges suaves, tablas limpias.
   ============================================================ */

/* ----- Tarjetas ----- */
.card {
  background: var(--c-card);
  border-radius: var(--r-lg);
  padding: 24px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Headings semánticos dentro de .card-title: heredan el estilo visual */
.card-title-h2 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  line-height: 1.3;
}

/* Título de tarjetas internas (detalle de alumno): H3 compacto */
.card-title-h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.3;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ----- Stat cards ----- */
.stat-card {
  background: var(--c-card);
  border-radius: var(--r-md);
  padding: 20px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-xs);
  border-left: 4px solid var(--c-primary);
  transition: box-shadow var(--t-med), transform var(--t-med);
}

.stat-card .label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card .value {
  font-size: 30px;
  font-weight: 700;
  margin-top: 6px;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.stat-card.warning { border-left-color: var(--warn); }
.stat-card.danger  { border-left-color: var(--bad); }
.stat-card.success { border-left-color: var(--ok); }
.stat-card.info    { border-left-color: var(--info); }

/* ----- Tablas ----- */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 2px solid var(--c-border);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-muted);
}

td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--c-border);
}

tr:hover td {
  background: #f8fafc;
}

/* ----- Badges ----- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success   { background: #d1fae5; color: #065f46; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-info      { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #e2e8f0; color: #475569; }

/* ----- Botones ----- */
.btn {
  padding: 9px 18px;
  border: none;
  border-radius: 10px;
  background: var(--c-primary);
  color: white;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--t-fast), box-shadow var(--t-fast),
              transform var(--t-fast), opacity var(--t-fast);
  font-size: 14px;
  box-shadow: var(--shadow-xs);
}

.btn:hover {
  background: var(--c-primary-strong);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-xs);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-outline {
  background: transparent;
  color: var(--c-primary);
  border: 1px solid var(--c-primary);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--c-primary-soft);
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-danger  { background: var(--bad); }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 6px 16px rgba(220, 38, 38, 0.28); }
.btn-success { background: var(--ok); color: var(--ok-text); }
.btn-success:hover { background: #065f46; box-shadow: 0 6px 16px rgba(4, 120, 87, 0.28); }

/* Variante contextual: botones outline dentro de la sidebar oscura */
.sidebar-footer .btn-outline {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.35);
}

.sidebar-footer .btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

/* ----- Formularios ----- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
  color: #334155;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Inputs sueltos fuera de form-group (ej. buscador) */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: inherit;
  background: #fff;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ----- Modal ----- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 31, 58, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: crm-fade-in 0.18s ease-out;
}

.modal {
  background: white;
  max-width: 600px;
  width: 90%;
  border-radius: var(--r-xl);
  padding: 30px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: crm-modal-in 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.modal h2 {
  margin-bottom: 20px;
  font-family: var(--font-display);
}

.modal .close-btn {
  float: right;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--c-muted);
  transition: color var(--t-fast), transform var(--t-fast);
}

.modal .close-btn:hover {
  color: var(--c-text);
  transform: rotate(90deg);
}

@keyframes crm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes crm-modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ----- Utilidades ----- */
.hidden {
  display: none !important;
}

/* ----- Cajas de alerta ----- */
.alert-box {
  background: #fef3c7;
  border-left: 4px solid var(--warn);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.alert-box.danger {
  background: #fee2e2;
  border-left-color: var(--bad);
}

.alert-box.warning {
  background: #fef9c3;
  border-left-color: var(--warn);
}

.alert-box.success {
  background: #dcfce7;
  border-left-color: var(--ok);
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   Task 7 — Toast + tarjetas/filas clickeables
   ============================================================ */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  padding: 12px 18px;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: crm-toast-in 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.toast-ok    { background: var(--ok); }
.toast-error { background: var(--bad); }

@keyframes crm-toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.stat-clickable {
  cursor: pointer;
  border-radius: var(--r-md);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.stat-clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-clickable:active {
  transform: translateY(-1px) scale(0.99);
}

.fila-clickeable { cursor: pointer; }

/* ============================================================
   Sistema de íconos SVG (CRM.icons)
   ============================================================ */

.crm-ico {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Variante inline: hereda 1em para integrarse en texto/badges */
.crm-ico-inline {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* Ícono dentro de un badge de estado: pequeño y delgado */
.badge .crm-ico-inline,
.chip .crm-ico-inline {
  width: 0.95em;
  height: 0.95em;
  stroke-width: 2.4;
  margin-right: 0.15em;
}

/* ============================================================
   Vista de Alertas / Notificaciones (rediseño)
   ============================================================ */

/* Cabecera de la vista con resumen + filtros */
.alerts-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.alerts-title-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alerts-title-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  flex-shrink: 0;
}

.alerts-title-ico .crm-ico { width: 21px; height: 21px; }

.alerts-title-block h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

.alerts-title-block p {
  font-size: 13px;
  color: var(--c-muted);
  margin: 2px 0 0;
}

/* Pills de filtro por tipo */
.alerts-filtros {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.alerts-filtro {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: #fff;
  color: var(--c-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-xs);
}

.alerts-filtro:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  transform: translateY(-1px);
}

.alerts-filtro.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.alerts-filtro .alerts-filtro-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.alerts-filtro.active .alerts-filtro-count {
  background: rgba(255, 255, 255, 0.25);
}

/* Resumen de conteo (alta/media/ok) */
.alerts-resumen {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.alerts-resumen-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  background: #fff;
  box-shadow: var(--shadow-xs);
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}

.alerts-resumen-pill .crm-ico { width: 17px; height: 17px; }

.alerts-resumen-pill-alta { border-left: 3px solid var(--bad); }
.alerts-resumen-pill-alta .crm-ico { color: var(--bad); }

.alerts-resumen-pill-media { border-left: 3px solid var(--warn); }
.alerts-resumen-pill-media .crm-ico { color: var(--warn); }

.alerts-resumen-pill-ok { border-left: 3px solid var(--ok); }
.alerts-resumen-pill-ok .crm-ico { color: var(--ok); }

.alerts-resumen-pill strong {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--c-navy);
  font-variant-numeric: tabular-nums;
}

.alerts-resumen-pill em {
  font-style: normal;
  color: var(--c-muted);
  font-weight: 500;
}

/* Toggle "Mostrar resueltas" modernizado */
.alerts-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.alerts-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c-text);
  user-select: none;
}

.alerts-toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background var(--t-fast);
  flex-shrink: 0;
}

.alerts-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-med);
}

.alerts-toggle input { display: none; }

.alerts-toggle input:checked ~ .alerts-toggle-switch {
  background: var(--c-primary);
}

.alerts-toggle input:checked ~ .alerts-toggle-switch::after {
  transform: translateX(18px);
}

/* Tarjeta de alerta individual */
.alert-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-border);
  border-radius: var(--r-md);
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
}

.alert-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.alert-card.alta  { border-left-color: var(--bad); }
.alert-card.media { border-left-color: var(--warn); }
.alert-card.baja  { border-left-color: var(--ok); }
.alert-card.info  { border-left-color: var(--info); }

.alert-card.resuelta {
  opacity: 0.62;
  border-left-color: var(--c-border);
}

.alert-card.resuelta .alert-card-msg {
  text-decoration: line-through;
  text-decoration-color: rgba(100, 116, 139, 0.5);
}

/* Ícono de prioridad */
.alert-card-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex-shrink: 0;
}

.alert-card-ico .crm-ico { width: 20px; height: 20px; }

.alert-card.alta  .alert-card-ico { background: #fee2e2; color: var(--bad); }
.alert-card.media .alert-card-ico { background: #fef3c7; color: #92400e; }
.alert-card.baja  .alert-card-ico { background: #d1fae5; color: var(--ok); }
.alert-card.info  .alert-card-ico { background: #dbeafe; color: var(--info); }

/* Cuerpo */
.alert-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 2px;
}

.alert-card-msg {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.4;
}

.alert-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--c-muted);
}

.alert-card-alumno {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px 3px 3px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--c-text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

.alert-card-alumno:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-primary-soft);
}

.alert-card-alumno .alert-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-card-fecha {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.alert-card-fecha .crm-ico { width: 13px; height: 13px; }

/* Acciones */
.alert-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.alert-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.alert-btn .crm-ico { width: 15px; height: 15px; }

.alert-btn-resolver {
  background: var(--ok);
  color: #fff;
}

.alert-btn-resolver:hover {
  background: #065f46;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.28);
  transform: translateY(-1px);
}

.alert-btn-reabrir {
  background: #fff;
  color: var(--c-muted);
  border-color: var(--c-border);
}

.alert-btn-reabrir:hover {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
}

/* Sección header de grupo (Pendientes / Resueltas) */
.alerts-group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 22px 0 12px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--c-navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.alerts-group-title .crm-ico { width: 16px; height: 16px; }

.alerts-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--c-bg-soft);
  color: var(--c-muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.alerts-group-title.resueltas .crm-ico { color: var(--ok); }
.alerts-group-title.pendientes .crm-ico { color: var(--warn); }

/* Estado vacío de alertas */
.alerts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin: 40px auto;
  padding: 36px 24px;
  text-align: center;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.alerts-empty-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #d1fae5;
  color: var(--ok);
}

.alerts-empty-ico .crm-ico { width: 26px; height: 26px; }

.alerts-empty h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--c-navy);
  margin: 0;
}

.alerts-empty p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-muted);
  margin: 0;
}

/* Responsive de alertas */
@media (max-width: 620px) {
  .alert-card {
    grid-template-columns: auto 1fr;
    gap: 12px;
  }
  .alert-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
  }
  .alert-card-msg { font-size: 13.5px; }
}

/* ============================================================
   Mejoras de la lista de alumnos (tabla moderna con avatares)
   ============================================================ */

.students-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.students-list-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.students-list-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  flex-shrink: 0;
}

.students-list-ico .crm-ico { width: 21px; height: 21px; }

.students-list-title h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-navy);
  letter-spacing: -0.02em;
  margin: 0;
}

.students-list-title p {
  font-size: 13px;
  color: var(--c-muted);
  margin: 2px 0 0;
}

.students-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 340px;
  height: 40px;
  padding: 0 14px;
  background: #f1f5f9;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  transition: all var(--t-fast);
}

.students-search:focus-within {
  background: #fff;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.students-search .crm-ico { width: 16px; height: 16px; color: #94a3b8; }

.students-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--c-text);
  outline: none;
}

.students-search input::placeholder { color: #94a3b8; }

/* Tabla de alumnos rediseñada */
.students-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.students-table thead th {
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-muted);
  border-bottom: 1px solid var(--c-border);
  background: #f8fafc;
  white-space: nowrap;
  text-align: left;
}

.students-table thead th:first-child { border-radius: 10px 0 0 10px; }
.students-table thead th:last-child { border-radius: 0 10px 10px 0; text-align: right; }

.students-table tbody tr {
  transition: background var(--t-fast);
  cursor: pointer;
}

.students-table tbody tr:hover td { background: #f6f8fc; }

.students-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #eef1f6;
  vertical-align: middle;
}

.students-table tbody tr:last-child td { border-bottom: none; }

.students-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.students-table .col-sec { color: var(--c-muted); font-size: 13px; }

/* Celda del alumno con avatar */
.student-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.student-cell .avatar { width: 34px; height: 34px; font-size: 12px; }

.student-cell-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.student-cell-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-cell-sub {
  font-size: 12px;
  color: var(--c-muted);
}

/* Acciones de fila */
.student-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.btn-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: #fff;
  color: var(--c-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-ico:hover { transform: translateY(-1px); }
.btn-ico .crm-ico { width: 15px; height: 15px; }

.btn-ico-view:hover {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
}

.btn-ico-danger:hover {
  color: var(--bad);
  border-color: var(--bad);
  background: #fee2e2;
}

/* Estado vacío de la lista */
.students-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin: 50px auto;
  padding: 40px 28px;
  text-align: center;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.students-empty-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
}

.students-empty-ico .crm-ico { width: 28px; height: 28px; }

.students-empty h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--c-navy);
  margin: 0;
}

.students-empty p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-muted);
  margin: 0;
}

/* ============================================================
   Detalle de alumno — mejoras
   ============================================================ */

/* Breadcrumb / cabecera del detalle */
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.detail-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.detail-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.detail-head-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.detail-head-name h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-navy);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.detail-head-name .detail-sub {
  font-size: 13px;
  color: var(--c-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-volver {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: #fff;
  color: var(--c-text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-xs);
}

.btn-volver:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-primary-soft);
  transform: translateY(-1px);
}

.btn-volver .crm-ico { width: 16px; height: 16px; }

/* Sección "Lo más importante" — título con ícono */
.kpi-destacado-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.kpi-destacado-title .crm-ico {
  width: 16px;
  height: 16px;
  color: #f59e0b;
}

/* KPI card con ícono en el label */
.kpi-card .kpi-label .crm-ico {
  width: 15px;
  height: 15px;
}

/* Ficha — grid moderno en lugar de filas dashed */
.ficha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.ficha-grid-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 14px;
  background: var(--c-card);
}

.ficha-grid-item .ficha-grid-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ficha-grid-item .ficha-grid-label .crm-ico { width: 14px; height: 14px; }

.ficha-grid-item .ficha-grid-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Tabs del detalle con íconos SVG */
.detail-tab .crm-ico {
  width: 15px;
  height: 15px;
}

/* Panel card de detalle con ícono en el título */
.card-title-h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-h3 .crm-ico {
  width: 16px;
  height: 16px;
  color: var(--c-primary);
}

/* Cuotas — estados con chips modernos */
.cuota-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.cuota-chip .crm-ico { width: 13px; height: 13px; }

.cuota-chip-pagada { background: #d1fae5; color: #065f46; }
.cuota-chip-pagada .crm-ico { color: var(--ok); }

.cuota-chip-vencida { background: #fee2e2; color: #991b1b; }
.cuota-chip-vencida .crm-ico { color: var(--bad); }

.cuota-chip-pendiente { background: #fef3c7; color: #92400e; }
.cuota-chip-pendiente .crm-ico { color: var(--warn); }

/* Resumen de cuotas moderno */
.cuota-resumen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 8px 0 20px;
}

.cuota-resumen-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}

.cuota-resumen-item .cuota-resumen-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cuota-resumen-item .cuota-resumen-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-navy);
  font-variant-numeric: tabular-nums;
}

/* Botones con íconos del detalle */
.btn .crm-ico,
.btn-sm .crm-ico {
  width: 15px;
  height: 15px;
}

.btn-with-ico {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Botón danger con ícono de eliminar */
.btn-eliminar-soft {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: #fff;
  color: var(--bad);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-eliminar-soft:hover {
  background: #fee2e2;
  border-color: var(--bad);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.15);
}

.btn-eliminar-soft .crm-ico { width: 15px; height: 15px; }

/* Zona peligrosa del detalle */
.detail-danger-zone {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: flex-end;
}

/* Banner de retiro de Skool modernizado */
.skool-retiro-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid var(--bad);
  border-radius: var(--r-md);
  margin-top: 14px;
}

.skool-retiro-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skool-retiro-banner .crm-ico {
  width: 22px;
  height: 22px;
  color: var(--bad);
  flex-shrink: 0;
}

.skool-retiro-banner strong {
  font-size: 14px;
  color: #991b1b;
}

/* Tabs del dashboard con íconos SVG */
.dash-tab .crm-ico {
  width: 15px;
  height: 15px;
}

/* Onboarding del dashboard con ícono */
.dash-onboarding-ico .crm-ico { width: 26px; height: 26px; }

/* Ícono de trending en KPI */
.trend .crm-ico { width: 12px; height: 12px; }

/* Footer */
.app-footer .crm-ico { width: 14px; height: 14px; vertical-align: -3px; margin-right: 4px; }
