/* ==========================================================================
   CRM Rematrícula — Panel Administrativo
   Se carga después de dashboard.css, componentes.css y seguimiento.css
   (reutiliza de este último la barra de herramientas, las píldoras de filtro,
   los resúmenes y las tablas del módulo).
   ========================================================================== */

.admin-section { padding: 0 22px 22px; }
.admin-section + .admin-section { padding-top: 22px; border-top: 1px solid var(--gray-100); }
.admin-section__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-section__title { font-size: 15px; font-weight: 650; }
.admin-section__text { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Resumen: indicadores ---------- */
.rate-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 16px 22px; }
.rate-card { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.rate-card__label { font-size: 12px; color: var(--text-muted); }
.rate-card__value { margin-top: 4px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rate-card__foot { margin-top: 2px; font-size: 11px; color: var(--gray-500); }
.rate-card--featured { color: #fff; border-color: transparent; background: linear-gradient(140deg, var(--purple-500), var(--purple-700)); }
.rate-card--featured .rate-card__label,
.rate-card--featured .rate-card__foot { color: rgba(255, 255, 255, .85); }

/* Pipeline global (barras horizontales) */
.pipeline-bars { display: flex; flex-direction: column; gap: 8px; }
.pbar {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 60px;
  gap: 12px;
  align-items: center;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pbar:hover { background: var(--gray-50); }
.pbar__track { display: block; height: 14px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.pbar__fill { display: block; height: 100%; border-radius: inherit; background: var(--purple-500); transition: width .6s ease; }
.pbar__n { font-weight: 700; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.pbar--pendiente .pbar__fill { background: var(--gray-400); }
.pbar--validada .pbar__fill { background: var(--purple-500); }
.pbar--observada .pbar__fill { background: var(--amber-600); }
.pbar--cambio .pbar__fill { background: var(--blue-600); }
.pbar--confirma .pbar__fill { background: var(--green-600); }
.pbar--conf-edit .pbar__fill { background: #0d9488; }
.pbar--no-remat .pbar__fill { background: var(--rose-500); }
.pbar--egresado .pbar__fill { background: var(--gray-500); }
.pbar--remat .pbar__fill { background: #047857; }

/* Carga de trabajo */
.table--load th, .table--load td { text-align: right; padding-left: 10px; padding-right: 10px; }
.table--load th { white-space: normal; line-height: 1.25; vertical-align: bottom; min-width: 60px; }
.table--load td:last-child, .table--load th:last-child { padding-right: 22px; }
.table--load th:first-child, .table--load td:first-child { text-align: left; }
.table--load td.is-link { cursor: pointer; color: var(--purple-700); font-weight: 600; }
.table--load td.is-link:hover { text-decoration: underline; }
.table--load tfoot td { font-weight: 700; background: var(--gray-25); border-top: 1px solid var(--border); }
.cell-warn { color: var(--rose-600) !important; }

/* Metas */
.goal-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 110px minmax(0, 2fr) 90px; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.goal-row--team { background: var(--purple-50); margin: 8px -12px 0; padding: 12px; border-radius: 10px; border-bottom: 0; }
.goal-row__name { font-weight: 600; }
.goal-row input { width: 100%; height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; font: inherit; text-align: right; }
.goal-row input:disabled { background: var(--gray-50); color: var(--gray-500); }
.goal-bar { height: 10px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.goal-bar__fill { height: 100%; border-radius: inherit; background: var(--purple-600); }
.goal-bar__fill.is-done { background: var(--green-600); }
.goal-row__pct { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.goal-row__meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Carteras */
.pick-list { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.pick-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--gray-100); cursor: pointer; }
.pick-item:last-child { border-bottom: 0; }
.pick-item:hover { background: var(--gray-50); }
.pick-item input { width: 16px; height: 16px; accent-color: var(--purple-600); }
.assign-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--gray-50); }
.assign-bar strong { color: var(--purple-700); }

/* Usuarios */
.role-badge { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.role-badge--Asesor { color: var(--gray-700); background: var(--gray-100); }
.role-badge--Supervisor { color: var(--blue-600); background: var(--blue-50); }
.role-badge--Administrador { color: var(--purple-700); background: var(--purple-100); }
.user-inactive td { opacity: .55; }

/* Estado del sistema */
.health { display: flex; align-items: center; gap: 12px; margin: 16px 22px; padding: 14px 16px; border-radius: var(--radius); font-size: 14px; }
.health .icon { width: 22px; height: 22px; }
.health--ok { color: #065f46; background: var(--green-50); border: 1px solid #a7f3d0; }
.health--bad { color: #9f1239; background: var(--rose-50); border: 1px solid #fecdd3; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-dot--CORRECTA, .status-dot--ENVIADO { color: var(--green-600); }
.status-dot--ERROR { color: var(--rose-600); }
.status-dot--OMITIDA, .status-dot--PENDIENTE { color: var(--amber-600); }
.status-dot--EN_CURSO { color: var(--blue-600); }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .rate-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .admin-section { padding: 0 16px 18px; }
  .rate-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 16px; }
  .pbar { grid-template-columns: 120px minmax(0, 1fr) 40px; font-size: 12px; }
  .goal-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .goal-row .goal-bar, .goal-row__pct { grid-column: 1 / -1; }
  .health { margin: 14px 16px; }
}
