/* ════════════════════════════════════════════════════════
   ISFIS GAMIFICACIÓN — "MTH Happiness Game" aplicado al LMS
   ════════════════════════════════════════════════════════ */

.isfis-cfg-hint {
    font-size:.78rem; color:var(--p-silver); margin:0 0 14px;
}

/* ── Tarjeta de perfil / nivel ── */
.lms-gamif-perfil-card {
    background: linear-gradient(135deg, var(--p-navy2) 0%, var(--p-navy3) 100%);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg, 14px);
    padding: 20px 24px;
    margin-bottom: 16px;
}
.lms-gamif-perfil-top {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.lms-gamif-nivel-icon {
    font-size: 2.6rem; line-height: 1;
    flex-shrink: 0;
}
.lms-gamif-nivel-info { flex: 1; min-width: 180px; }
.lms-gamif-nivel-nombre {
    font-family: var(--lms-serif, 'DM Serif Display', serif);
    font-size: 1.3rem; color: var(--p-white); margin: 0 0 2px;
}
.lms-gamif-nivel-rango {
    font-size: .78rem; color: var(--p-silver);
}
.lms-gamif-puntos {
    text-align: right; flex-shrink: 0;
}
.lms-gamif-puntos-num {
    font-size: 1.8rem; font-weight: 700; color: var(--p-gold);
    line-height: 1;
}
.lms-gamif-puntos-label {
    font-size: .7rem; color: var(--p-silver); text-transform: uppercase; letter-spacing: .08em;
}

/* Barra de progreso al siguiente nivel */
.lms-gamif-progress-track {
    width: 100%; height: 10px; border-radius: 6px;
    background: rgba(148,163,184,.15);
    overflow: hidden; margin-bottom: 6px;
}
.lms-gamif-progress-fill {
    height: 100%; border-radius: 6px;
    background: linear-gradient(90deg, var(--p-gold), #E8C96A);
    transition: width .4s ease;
}
.lms-gamif-progress-label {
    font-size: .76rem; color: var(--p-silver); display: flex; justify-content: space-between;
}

/* ── Estadísticas rápidas (racha, ranking) ── */
.lms-gamif-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.lms-gamif-stat {
    background: var(--p-glass, rgba(255,255,255,.03));
    border: 1px solid var(--p-border2);
    border-radius: 10px;
    padding: 12px 14px;
    text-align: center;
}
.lms-gamif-stat-val {
    font-size: 1.5rem; font-weight: 700; color: var(--p-white);
}
.lms-gamif-stat-label {
    font-size: .72rem; color: var(--p-silver); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px;
}

/* ── Secciones ── */
.lms-gamif-section { margin-bottom: 20px; }
.lms-gamif-section-title {
    font-family: var(--lms-serif, 'DM Serif Display', serif);
    font-size: 1.05rem; color: var(--p-white); margin: 0 0 10px;
    font-weight: 400;
}

/* ── Grid de insignias ── */
.lms-gamif-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.lms-gamif-badge {
    background: var(--p-glass, rgba(255,255,255,.03));
    border: 1px solid var(--p-border2);
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    transition: transform .15s, border-color .15s;
}
.lms-gamif-badge--obtenida {
    border-color: rgba(201,168,76,.4);
    background: rgba(201,168,76,.06);
}
.lms-gamif-badge--obtenida:hover { transform: translateY(-2px); }
.lms-gamif-badge--bloqueada { opacity: .45; }
.lms-gamif-badge-icon { font-size: 1.8rem; margin-bottom: 6px; }
.lms-gamif-badge--bloqueada .lms-gamif-badge-icon { filter: grayscale(1); }
.lms-gamif-badge-nombre {
    font-size: .8rem; font-weight: 600; color: var(--p-white2); margin-bottom: 3px;
}
.lms-gamif-badge-desc {
    font-size: .7rem; color: var(--p-silver); line-height: 1.35;
}

/* ── Ranking ── */
.lms-gamif-ranking-tabs {
    display: flex; gap: 6px; margin-bottom: 10px;
}
.lms-gamif-rtab {
    background: var(--p-glass, rgba(255,255,255,.03));
    border: 1px solid var(--p-border2);
    color: var(--p-silver) !important;
    -webkit-text-fill-color: var(--p-silver) !important;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: .8rem;
    cursor: pointer;
    transition: all .15s;
}
.lms-gamif-rtab--active {
    background: var(--p-gold) !important;
    color: var(--p-navy) !important;
    -webkit-text-fill-color: var(--p-navy) !important;
    border-color: var(--p-gold);
    font-weight: 600;
}
.lms-gamif-rank-row {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: var(--p-glass, rgba(255,255,255,.03));
    border: 1px solid var(--p-border2);
}
.lms-gamif-rank-row--tu {
    border-color: rgba(201,168,76,.5);
    background: rgba(201,168,76,.08);
}
.lms-gamif-rank-pos {
    font-weight: 700; color: var(--p-gold);
    width: 28px; text-align: center; flex-shrink: 0;
    font-size: .9rem;
}
.lms-gamif-rank-name {
    flex: 1; color: var(--p-white2); font-size: .85rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lms-gamif-rank-pts {
    color: var(--p-gold); font-weight: 600; font-size: .85rem; flex-shrink: 0;
}

/* ── Historial ── */
.lms-gamif-hist-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--p-border2);
    font-size: .82rem;
}
.lms-gamif-hist-row:last-child { border-bottom: none; }
.lms-gamif-hist-motivo { color: var(--p-white2); }
.lms-gamif-hist-fecha { color: var(--p-silver); font-size: .72rem; margin-left: 8px; }
.lms-gamif-hist-puntos { color: var(--p-green, #34C97A); font-weight: 700; flex-shrink: 0; }

/* ── Admin: grid de configuración ── */
.lms-gamif-cfg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 16px;
}

/* ── Admin: tabla de ranking ── */
.lms-gamif-admin-table {
    width: 100%; border-collapse: collapse; font-size: .82rem;
}
.lms-gamif-admin-table th {
    text-align: left; padding: 8px 10px; color: var(--p-silver);
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    border-bottom: 1px solid var(--p-border);
}
.lms-gamif-admin-table td {
    padding: 8px 10px; color: var(--p-white2);
    border-bottom: 1px solid var(--p-border2);
}
.lms-gamif-admin-table tr:hover td { background: var(--p-glass, rgba(255,255,255,.03)); }

/* ── Empty state ── */
.lms-gamif-empty {
    text-align: center; padding: 1.5rem; color: var(--p-silver); font-size: .85rem;
}

@media (max-width: 600px) {
    .lms-gamif-perfil-top { flex-direction: column; align-items: flex-start; }
    .lms-gamif-puntos { text-align: left; }
}

/* ════════════════════════════════════════════════════════
   CONTROL DE VENTAS — [isfis_ventas]
   ════════════════════════════════════════════════════════ */

/* Tabs propios (independientes de isfis-panel.js) */
.lms-ventas-tab {
    background: transparent; border: none;
    color: rgba(148,163,184,.6);
    padding: 12px 16px; font-size: .82rem; font-weight: 400;
    cursor: pointer; white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: all .22s; -webkit-tap-highlight-color: transparent;
    min-height: 44px; flex-shrink: 0; font-family: var(--p-font);
    letter-spacing: .01em;
}
.lms-ventas-tab:hover { color: var(--p-white2); }
.lms-ventas-tab--active {
    color: var(--p-gold) !important;
    border-bottom-color: var(--p-gold) !important;
    font-weight: 500 !important;
}
.lms-ventas-content { display: none; padding: 24px; box-sizing: border-box; width: 100%; overflow: hidden; background: var(--p-navy); }
.lms-ventas-content--active { display: block; }

/* Formulario de registro de actividad */
.lms-ventas-form {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.lms-ventas-select { flex: 1 1 240px; min-width: 0; }
.lms-ventas-nota   { flex: 2 1 280px; min-width: 0; }
.lms-ventas-form .isfis-panel__btn { flex-shrink: 0; }

/* Resumen de equipo */
.lms-ventas-team-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: var(--p-glass, rgba(255,255,255,.03));
    border: 1px solid var(--p-border2);
}
.lms-ventas-team-row--alerta { border-color: rgba(217,32,46,.4); background: rgba(217,32,46,.06); }
.lms-ventas-team-name { flex: 1 1 140px; color: var(--p-white2); font-size: .85rem; font-weight: 600; }
.lms-ventas-team-meta { font-size: .78rem; color: var(--p-silver); }
.lms-ventas-team-pts  { color: var(--p-gold); font-weight: 700; font-size: .9rem; }
.lms-ventas-team-alerta {
    font-size: .72rem; color: #ff8a8a; font-weight: 600;
    background: rgba(217,32,46,.12); border-radius: 6px; padding: 2px 8px;
}

@media (max-width: 600px) {
    .lms-ventas-select, .lms-ventas-nota { flex-basis: 100%; }
}
