/* ═══════════════════════════════════════════════════════════════════════
   SG-SST — zona interactiva
   ═══════════════════════════════════════════════════════════════════════
   Se monta sobre la hoja de Inspecciones (module-insp.css): bienvenida,
   tira de datos, tres columnas, paneles, respuestas y botones son los
   mismos. Aquí va lo propio de la autoevaluación: los grupos con sus
   pendientes, el puntaje sobre la rueda, la evidencia del repositorio, el
   plan de mejora y el plan del año por semestres.

   Igual que allá: sin cajas ni líneas que dividan, el contenido se separa
   con aire, y los tamaños en px porque el diseño los fija así.
   ═══════════════════════════════════════════════════════════════════════ */

/* ══════════════════ La portada ══════════════════ */
/* La rueda va a la derecha del título desde escritorio, como el andamio
   de TAR: detrás de un título centrado competiría con él. */
.sg .pi-hello__veil {
    background-image: radial-gradient(ellipse 60% 38% at 50% 50%,
        rgba(6, 6, 16, 0.88) 0%,
        rgba(6, 6, 16, 0.66) 50%,
        rgba(6, 6, 16, 0) 92%);
}

@media (min-width: 1024px) {
    .sg .pi-hello { align-items: flex-start; text-align: left; }

    .sg .pi-hello__say {
        align-items: flex-start;
        max-width: 34rem;
        margin-inline: 0;
        padding-left: clamp(0px, 4vw, 64px);
    }

    .sg .pi-hello__veil {
        background-image: radial-gradient(ellipse 46% 56% at 22% 50%,
            rgba(6, 6, 16, 0.82) 0%,
            rgba(6, 6, 16, 0.5) 55%,
            rgba(6, 6, 16, 0) 92%);
    }
}

/* ══════════════════ Los grupos ══════════════════ */
.sg-groups { gap: 14px; }

.sg-group { display: flex; flex-direction: column; gap: 2px; }

.sg-group__top {
    display: grid;
    grid-template-columns: 1.1rem minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
}

.sg-group__cycle { font-size: 11px; font-weight: 800; }
.sg-group__name { font-size: 13px; font-weight: 600; color: var(--pi-ink-2); line-height: 1.3; }

.sg-group__n {
    font-size: 10px;
    font-weight: 700;
    color: var(--pi-ink-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Los pendientes cuelgan de su grupo y se abren al tocarlos */
.sg-pend {
    display: grid;
    grid-template-columns: 0.5rem 2.6rem minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 5px 6px 5px 1.1rem;
    background: none;
    border: 0;
    color: var(--pi-ink-3);
    font-family: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-smooth), background-color var(--duration-fast) var(--ease-smooth);
}

.sg-pend:hover { color: var(--pi-ink-2); background: rgba(34, 211, 238, 0.05); }
.sg-pend.is-on { color: var(--pi-ink); font-weight: 600; background: rgba(34, 211, 238, 0.07); }

.sg-pend__dot {
    width: 0.44rem;
    height: 0.44rem;
    border: 1.5px solid var(--pi-line-2);
    border-radius: 50%;
    box-sizing: border-box;
}

.sg-pend__c { font-variant-numeric: tabular-nums; font-weight: 700; }
.sg-pend__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══════════════════ La rueda ══════════════════ */
/* El puntaje vive en el centro de la rueda, siempre al frente */
.sg-center {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transform: translate(-50%, -62%);
    text-align: center;
    text-shadow: 0 2px 18px #060610;
    pointer-events: none;
}

.sg-center__num {
    font-size: clamp(38px, 5vw, 64px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.9;
    font-variant-numeric: tabular-nums;
    transition: color var(--duration-slow) var(--ease-smooth);
}

.sg-center__band {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pi-ink-2);
}

.sg-cycle {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-shadow: 0 1px 10px #060610;
    pointer-events: none;
    transition: opacity var(--duration-fast) var(--ease-smooth);
}

.sg-cycle.is-behind { opacity: 0.35; }

/* Nombre del ciclo y, debajo, cuántos estándares tiene */
.sg-cycle { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.sg-cycle__n {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: none;
    color: var(--pi-ink-2);
}

.sg-spot { width: 1.1rem; height: 1.1rem; }
.sg-spot.is-on { width: 1.5rem; height: 1.5rem; }

.sg-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.sg-legend__i { display: inline-flex; align-items: center; gap: 7px; }

.sg-legend__sw {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 2px;
    box-sizing: border-box;
}

.sg-legend__sw--ok { background: #22D3EE; }
.sg-legend__sw--bad { background: #ff4d5e; }
.sg-legend__sw--pend { border: 1.5px solid #22D3EE; opacity: 0.6; }

/* ══════════════════ Los paneles ══════════════════ */
.sg-big { display: flex; flex-direction: column; gap: 6px; }

.sg-big__num {
    font-size: 62px;
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 0.9;
    font-variant-numeric: tabular-nums;
}

.sg-big__band { font-size: 15px; font-weight: 600; color: var(--pi-ink-2); }

.sg-note { margin: 0; max-width: 44ch; font-size: 12.5px; line-height: 1.5; color: var(--pi-ink-3); }

.sg-weight {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pi-ink-3);
}

/* La evidencia: una fila por documento del repositorio */
.sg-ev { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.sg-ev__pick { font-size: 13px; color: var(--pi-ink-2); padding-bottom: 4px; }

.sg-doc {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    width: 100%;
    padding: 11px 0 11px 14px;
    margin-left: -14px;
    background: none;
    border: 0;
    border-radius: 12px;
    color: var(--pi-ink);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: box-shadow var(--duration-fast) var(--ease-smooth), background-color var(--duration-fast) var(--ease-smooth);
}

.sg-doc:hover { background: rgba(250, 250, 250, 0.03); }
.sg-doc.is-ok { box-shadow: inset 3px 0 0 0 #22c55e; }
.sg-doc.is-bad { box-shadow: inset 3px 0 0 0 #ef4444; }

.sg-doc__ic { display: flex; color: var(--pi-ink-3); margin-top: 1px; }
.sg-doc.is-ok .sg-doc__ic { color: #22c55e; }
.sg-doc.is-bad .sg-doc__ic { color: #ef4444; }

.sg-doc__t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sg-doc__name { font-size: 14px; font-weight: 500; line-height: 1.35; }
.sg-doc__why { font-size: 12.5px; line-height: 1.4; color: #fca5a5; }
.sg-doc__why--ok { color: #86efac; }

.sg-alert {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    max-width: 46ch;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    color: #fca5a5;
}

.sg-alert svg { margin-top: 3px; }

/* Las acciones del plan de mejora */
.sg-plan { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }

.sg-act {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 14px;
    margin-left: -14px;
    box-shadow: inset 3px 0 0 0 #ef4444;
}

.sg-act__c { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pi-ink-3); }
.sg-act__t { font-size: 14px; font-weight: 500; line-height: 1.35; }
.sg-act__m { font-size: 12px; color: var(--pi-ink-3); font-variant-numeric: tabular-nums; }

/* ══════════════════ El plan del año ══════════════════ */
.sg-sems { display: flex; flex-direction: column; gap: 14px; }
.sg-sem { display: flex; flex-direction: column; gap: 6px; }
.sg-sem__top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.sg-sem__name { font-weight: 600; }
.sg-sem__v { color: var(--pi-ink-3); font-variant-numeric: tabular-nums; }

.sg-sem__bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(250, 250, 250, 0.08);
    overflow: hidden;
}

.sg-sem__bar i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: #22c55e;
    transition: width var(--duration-normal) var(--ease-smooth), background-color var(--duration-normal) var(--ease-smooth);
}

.sg-sem.is-over .sg-sem__bar i { background: #ef4444; }
.sg-sem.is-over .sg-sem__v { color: #fca5a5; }
.sg-sem__over { font-size: 12px; font-weight: 600; color: #fca5a5; }

.sg-year { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }

.sg-yrow {
    display: grid;
    grid-template-columns: 6.2rem minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 6px 0;
}

/* Mover una acción de mes: flechas a los lados del mes */
.sg-month { display: flex; align-items: center; justify-content: space-between; gap: 4px; }

.sg-month__b {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    background: rgba(34, 211, 238, 0.08);
    border: 0;
    border-radius: 50%;
    color: var(--pi-cyan);
    cursor: pointer;
    transition: background-color var(--duration-fast) var(--ease-smooth);
}

.sg-month__b:hover { background: rgba(34, 211, 238, 0.18); }
.sg-month__b:disabled { opacity: 0.25; cursor: default; }

.sg-month__v {
    min-width: 2.4rem;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.sg-yrow__t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.sg-done {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 9px;
    margin: 0;
    max-width: 44ch;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--pi-ink-2);
}

.sg-done svg { margin-top: 4px; color: #22c55e; }

.sg-go--off,
.sg-go--off:hover { display: inline-flex; align-items: center; gap: 8px; opacity: 0.45; cursor: not-allowed; transform: none; }

/* ══════════════════ Escritorio ══════════════════ */
@media (min-width: 1024px) {
    .pi-cols { grid-template-columns: 15rem minmax(0, 2fr) minmax(23rem, 0.95fr); }
    .sg-groups { justify-content: flex-start; }

    /* La acción va junto a su contenido, no al fondo del panel */
    .pi-panel__foot.sg-foot--near { margin-top: 0; }
}

/* ══════════════════ El detalle de un estándar ══════════════════ */
.sg-state { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; }
.sg-gap { margin: 0; max-width: 46ch; font-size: 14px; line-height: 1.5; color: var(--pi-ink-2); }
.sg-doc--read { cursor: default; }
.sg-doc--read:hover { background: none; }

/* En la leyenda, cumplir es tomar el color de su ciclo */
.sg-legend__sw--ok {
    width: 1.3rem;
    background: linear-gradient(90deg, #4C6FFF 0 25%, #1E9BFF 25% 50%, #14C8B4 50% 75%, #7FE7FF 75% 100%);
}

.sg-legend__sw--pend { border-color: var(--pi-ink-3); }

/* ══════════════════ El plan del año, por semestres ══════════════════ */
.sg-okline {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    color: #86efac;
}

.sg-okline svg { margin-top: 3px; }

/* Cada semestre es un bloque fijo: presupuesto arriba, sus acciones debajo */
.sg-semblock {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0 6px 14px;
    margin-left: -14px;
    box-shadow: inset 3px 0 0 0 #22c55e;
    transition: box-shadow var(--duration-normal) var(--ease-smooth);
}

.sg-semblock.is-over { box-shadow: inset 3px 0 0 0 #ef4444; }
.sg-semblock.is-over .sg-sem__bar i { background: #ef4444; }
.sg-semblock.is-over .sg-sem__v { color: #fca5a5; }

.sg-sem__name { display: flex; flex-direction: column; gap: 1px; }
.sg-sem__range { font-size: 11px; font-weight: 500; color: var(--pi-ink-3); }

.sg-semblock .sg-yrow {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 14px;
}

.sg-move {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    background: rgba(34, 211, 238, 0.1);
    border: 0;
    border-radius: 999px;
    color: var(--pi-cyan);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--duration-fast) var(--ease-smooth);
}

.sg-move:hover { background: rgba(34, 211, 238, 0.2); }

.sg-move--quiet {
    grid-column: 2;
    background: none;
    padding: 0 12px;
    color: var(--pi-ink-3);
    font-weight: 600;
}

.sg-move--quiet:hover { background: none; color: var(--pi-ink-2); }

/* ══════════════════ La sugerencia del plan ══════════════════ */
/* El sistema hace la cuenta: se lee qué propone y se aplica con un botón */
.sg-suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 6px; }

.sg-suggest__k {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.01em;
    background-image: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sg-suggest__k svg { color: var(--pi-cyan); }
.sg-suggest__list { display: flex; flex-direction: column; gap: 6px; }
.sg-suggest__t { margin: 0; max-width: 44ch; font-size: 16px; font-weight: 500; line-height: 1.4; color: var(--pi-ink); }
.sg-suggest .pi-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }

.sg-manual {
    align-self: flex-start;
    padding: 0;
    background: none;
    border: 0;
    color: var(--pi-ink-3);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-smooth);
}

.sg-manual:hover { color: var(--pi-ink-2); }

.sg-suggest__i { display: flex; flex-direction: column; gap: 3px; }
.sg-suggest__m { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--pi-cyan); }

/* ══════════════════ El plan del año, en barras ══════════════════ */
/* Cada semestre es una barra de presupuesto hecha de acciones, una por
   segmento y con el ancho de su costo. Una línea marca el tope y lo que
   se pasa se ve en rojo. Tocar un segmento lo pasa al otro semestre. */
.sg-tracks { display: flex; flex-direction: column; gap: 16px; }
.sg-track { display: flex; flex-direction: column; gap: 8px; }
.sg-track.is-over .sg-sem__v { color: #fca5a5; }

.sg-track__bar {
    position: relative;
    display: flex;
    gap: 3px;
    height: 2.1rem;
    padding: 4px 0;
}

.sg-seg {
    flex: none;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast) var(--ease-smooth);
}

.sg-seg:hover { transform: translateY(-2px); }

/* Lo que magIA propone mover late suave, y su hueco espera en el otro */
.sg-seg.is-sug { box-shadow: 0 0 0 2px #060610, 0 0 0 4px var(--pi-cyan); animation: dcFadeUp var(--duration-slow) var(--ease-smooth) both; }
.sg-seg.is-new { box-shadow: 0 0 0 2px #060610, 0 0 0 4px #22c55e; }

.sg-seg--ghost {
    background: none;
    border: 1.5px dashed var(--pi-cyan);
    cursor: default;
    opacity: 0.7;
}

.sg-seg--ghost:hover { transform: none; }

.sg-track__cap {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    margin-left: -1px;
    background: var(--pi-ink);
    border-radius: 1px;
    pointer-events: none;
}

.sg-track__over {
    position: absolute;
    top: 0;
    bottom: 0;
    background: repeating-linear-gradient(135deg, rgba(239, 68, 68, 0.55) 0 6px, rgba(239, 68, 68, 0.2) 6px 12px);
    border-radius: 0 6px 6px 0;
    pointer-events: none;
}

.sg-dot { flex: none; width: 0.7rem; height: 0.7rem; border-radius: 3px; margin-top: 4px; }

.sg-suggest__i { display: flex; align-items: flex-start; gap: 10px; flex-direction: row; }
.sg-suggest__t { display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--pi-ink); }
.sg-suggest__m { font-size: 13px; font-weight: 700; color: var(--pi-cyan); }

.sg-changes { display: flex; flex-direction: column; gap: 8px; }
.sg-change__m { font-size: 13px; font-weight: 700; color: #86efac; }

.sg-legendlist { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }

.sg-lrow {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 7px 8px 7px 0;
    background: none;
    border: 0;
    color: var(--pi-ink);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color var(--duration-fast) var(--ease-smooth);
}

.sg-lrow:hover { background: rgba(250, 250, 250, 0.03); }
.sg-lrow__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sg-lrow__name { font-size: 13px; line-height: 1.35; }
.sg-lrow__m { font-size: 11.5px; color: var(--pi-ink-3); font-variant-numeric: tabular-nums; }

/* ══════════════════ Ajustes del plan del año ══════════════════ */
/* El panel nunca se desplaza de lado */
.sg .pi-side { overflow-x: hidden; }

/* Los bloques se encogen si con sus separaciones no caben en la barra */
.sg-seg { flex: 0 1 auto; min-width: 6px; }

/* Las filas de la lista van alineadas a la izquierda, cortas o largas */
.sg-lrow { justify-content: flex-start; }
.sg-lrow .sg-dot, .sg-suggest__i .sg-dot { margin-top: 5px; }

/* El avatar de magIA en la sugerencia y en su botón */
.sg-magia {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.sg-suggest__k { gap: 9px; }

.sg-go--magia { display: inline-flex; align-items: center; gap: 10px; padding-left: 14px; }

.sg-magia--btn {
    width: 26px;
    height: 26px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

/* ══════════════════ magIA trabajando ══════════════════ */
/* El botón se vuelve una barra de luz que recorre el degradado de la
   marca, y el avatar late mientras reorganiza el plan. */
.sg-go--magia.is-working {
    background-image: linear-gradient(110deg, #1E7BFF 0%, #22D3EE 30%, #7FE7FF 45%, #22D3EE 60%, #1E7BFF 100%);
    background-size: 260% 100%;
    cursor: progress;
    animation: sgShimmer 1.6s linear infinite;
}

.sg-go--magia.is-working:hover { transform: none; }
.sg-go--magia.is-working .sg-magia--btn { animation: sgMagiaPulse 0.9s var(--ease-in-out) infinite; }

/* El bloque que vuela deja un halo cian mientras cruza */
.sg-seg.is-flying {
    position: relative;
    z-index: 2;
    box-shadow: 0 0 0 2px #060610, 0 0 16px 5px rgba(34, 211, 238, 0.8);
}

/* El paso en curso de la sugerencia brilla; los hechos quedan en verde */
.sg-suggest__i { transition: opacity var(--duration-normal) var(--ease-smooth); }
.sg-suggest__i.is-now .sg-suggest__m { animation: sgMagiaText 1s var(--ease-in-out) infinite; }
.sg-suggest__i.is-done { opacity: 0.75; }
.sg-suggest__i.is-done .sg-suggest__m { color: #86efac; }

.sg-suggest__i.is-done .sg-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #060610;
}

.sg-okline--work { color: var(--pi-cyan); }
.sg-okline--work { grid-template-columns: 20px minmax(0, 1fr); align-items: center; }

/* ══════════════════ La tira de datos en celular ══════════════════ */
/* El avance ocupa su propio renglón a todo el ancho: en una columna
   estrecha el rótulo se partía o se cortaba. Solo desde escritorio, donde
   hay espacio, vuelve a la fila con los demás datos. */
.pi-strip .pi-dato--grow {
    flex: 1 1 100%;
    order: 10;
    padding: 14px 0 0;
}

.pi-strip .pi-dato--grow .pi-dato__k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (min-width: 1024px) {
    .pi-strip .pi-dato--grow {
        flex: 1 1 12rem;
        min-width: 12rem;
        order: 0;
        padding: 0 22px;
    }
}
