/**
 * CIEM IA+ · Fase 1.2 — Estilos acotados (violeta elegante, Arial 12pt)
 * No modifica #ciem_f11_origen ni el lienzo cian de la Fase 1.1.
 */

/* —— Barra de pestañas Fase 1.1 / 1.2 —— */
#ciem_fase1_pestanas.ciem-f12-pestanas {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 22px 0 20px 0;
    padding: 0;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    line-height: 1.45;
    color: #0f172a;
    clear: both;
    position: relative;
    z-index: 30;
}

#ciem_fase1_pestanas .ciem-f12-pestanas-titulo {
    margin: 0 0 10px 0;
    padding: 0 4px;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f172a;
}

#ciem_fase1_pestanas .ciem-f12-pestanas-sub {
    margin: 0 0 14px 0;
    padding: 0 4px;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    color: #475569;
    line-height: 1.5;
}

#ciem_fase1_pestanas .ciem-f12-pestanas-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid #38bdf8;
    background: #f8fafc;
    box-shadow: 0 16px 40px rgba(14, 165, 233, 0.2), 0 4px 12px rgba(15, 23, 42, 0.08);
}

#ciem_fase1_pestanas.ciem-f12-modo-12 .ciem-f12-pestanas-tabs {
    border-color: #8b5cf6;
    box-shadow: 0 16px 40px rgba(124, 58, 237, 0.22), 0 4px 12px rgba(15, 23, 42, 0.08);
}

#ciem_fase1_pestanas .ciem-f12-pestana {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 76px;
    padding: 18px 20px;
    margin: 0;
    border: none;
    border-radius: 0;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #64748b;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

#ciem_fase1_pestanas .ciem-f12-pestana[data-fase="1.1"] {
    border-right: 2px solid rgba(56, 189, 248, 0.35);
}

#ciem_fase1_pestanas .ciem-f12-pestana[data-fase="1.2"] {
    border-left: 2px solid rgba(167, 139, 250, 0.25);
}

#ciem_fase1_pestanas .ciem-f12-pestana-linea {
    display: block;
    font-size: 12pt;
    font-weight: 1000;
}

#ciem_fase1_pestanas .ciem-f12-pestana-desc {
    display: block;
    font-size: 12pt;
    font-weight: 600;
}

#ciem_fase1_pestanas .ciem-f12-pestana[data-fase="1.1"].ciem-f12-pestana--activa {
    background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 45%, #0ea5e9 100%);
    color: #0f172a;
    box-shadow: inset 0 -4px 0 #0369a1;
}

#ciem_fase1_pestanas .ciem-f12-pestana[data-fase="1.2"].ciem-f12-pestana--activa {
    background: linear-gradient(180deg, #ddd6fe 0%, #a78bfa 45%, #7c3aed 100%);
    color: #ffffff;
    box-shadow: inset 0 -4px 0 #5b21b6;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

#ciem_fase1_pestanas .ciem-f12-pestana[data-fase="1.2"].ciem-f12-pestana--activa .ciem-f12-pestana-linea,
#ciem_fase1_pestanas .ciem-f12-pestana[data-fase="1.2"].ciem-f12-pestana--activa .ciem-f12-pestana-desc {
    color: #ffffff;
}

#ciem_fase1_pestanas .ciem-f12-pestana:focus-visible {
    outline: 3px solid #0f172a;
    outline-offset: 2px;
    z-index: 2;
}

.ciem-fase1-viewport--12[hidden],
.ciem-fase1-viewport--11.ciem-fase1-viewport--oculta {
    display: none !important;
}

/* Ocultar legado Ruta B embebido en 1.1 cuando el módulo 1.2 está activo o en pestaña 1.1 */
#ciem_fase1_1_viewport.ciem-fase1-legacy-ruta-oculta #ciem_rutas_selector,
#ciem_fase1_1_viewport.ciem-fase1-legacy-ruta-oculta #ciem_ruta_b_shell {
    display: none !important;
}

/* —— Shell Fase 1.2 —— */
#ciem_f12_shell.ciem-f12-shell {
    width: 100%;
    box-sizing: border-box;
    margin: 8px 0 24px 0;
    padding: 22px;
    border-radius: 16px;
    border: 3px solid #8b5cf6;
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 42%, #f5f3ff 100%);
    color: #0f172a;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    line-height: 1.45;
    box-shadow: 0 18px 48px rgba(91, 33, 182, 0.16);
    animation: ciemF12FadeIn 0.28s ease;
}

@keyframes ciemF12FadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

#ciem_f12_shell .ciem-f12-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e9d5ff;
}

#ciem_f12_shell .ciem-f12-banner-titulo {
    margin: 0 0 10px 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #1e1b4b;
    border: 1px solid rgba(167, 139, 250, 0.45);
    color: #e9d5ff;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.4;
}

#ciem_f12_shell .ciem-f12-titulo {
    margin: 0;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 1000;
    color: #5b21b6;
}

#ciem_f12_shell .ciem-f12-sub,
#ciem_f12_shell .ciem-f12-lead,
#ciem_f12_shell .ciem-f12-ayuda {
    font-family: Arial, sans-serif;
    font-size: 12pt;
    line-height: 1.5;
}

#ciem_f12_shell .ciem-f12-sub {
    margin: 6px 0 0 0;
    color: #475569;
}

#ciem_f12_shell .ciem-f12-lead {
    margin: 0 0 14px 0;
    font-weight: 700;
    color: #6d28d9;
}

#ciem_f12_shell .ciem-f12-ayuda {
    margin: 0 0 14px 0;
    color: #475569;
}

#ciem_f12_shell .ciem-f12-badge {
    padding: 10px 16px;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 900;
}

#ciem_f12_shell .ciem-f12-ctrl {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

#ciem_f12_shell .ciem-f12-btn-mentor {
    display: inline-flex;
    align-items: center;
    padding: 14px 20px;
    border-radius: 12px;
    border: 2px solid #6d28d9;
    background: linear-gradient(180deg, #ede9fe, #ffffff);
    color: #4c1d95;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 900;
    text-decoration: none;
}

#ciem_f12_shell .ciem-f12-btn-sync {
    padding: 14px 22px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(180deg, #a78bfa, #7c3aed);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 900;
    cursor: pointer;
}

#ciem_f12_shell .ciem-f12-btn-reset {
    padding: 14px 20px;
    border-radius: 12px;
    border: 2px solid #c4b5fd;
    background: linear-gradient(180deg, #faf5ff, #f5f3ff);
    color: #5b21b6;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(91, 33, 182, 0.12);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#ciem_f12_shell .ciem-f12-btn-reset:hover {
    border-color: #7c3aed;
    background: linear-gradient(180deg, #ede9fe, #ddd6fe);
    color: #4c1d95;
}

#ciem_f12_shell .ciem-f12-btn-reset:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

#ciem_f12_shell .ciem-f12-grid-campos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

#ciem_f12_shell .ciem-f12-lbl--full {
    grid-column: 1 / -1;
}

#ciem_f12_shell .ciem-f12-lbl {
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 900;
    color: #0f172a;
}

#ciem_f12_shell .ciem-f12-input,
#ciem_f12_shell .ciem-f12-textarea {
    display: block;
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 10px;
    border: 2px solid #c4b5fd;
    background: #fff;
    font-family: Arial, sans-serif;
    font-size: 12pt;
}

#ciem_f12_shell .ciem-f12-matriz-wrap,
#ciem_f12_shell .ciem-f12-plan-wrap {
    padding: 18px;
    border-radius: 14px;
    border: 2px dashed #a78bfa;
    background: #fff;
}

#ciem_f12_shell .ciem-f12-plan-wrap {
    margin-top: 18px;
    background: #faf5ff;
}

#ciem_f12_shell .ciem-f12-matriz-titulo {
    margin: 0 0 8px 0;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 1000;
    color: #5b21b6;
}

#ciem_f12_shell .ciem-f12-matriz-status {
    margin: 0 0 10px 0;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    color: #64748b;
}

#ciem_f12_shell .ciem-f12-tabla {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 12pt;
}

#ciem_f12_shell .ciem-f12-tabla th {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 3px solid #c4b5fd;
    background: #f5f3ff;
    color: #5b21b6;
    font-weight: 900;
}

#ciem_f12_shell .ciem-f12-tabla td {
    padding: 10px;
    border-bottom: 1px solid #ede9fe;
    vertical-align: top;
}

#ciem_f12_shell .ciem-f12-tabla code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 11pt;
    color: #6d28d9;
    font-weight: 700;
}

#ciem_f12_shell .ciem-f12-plan-nota td {
    padding: 14px 12px;
    border-top: 2px solid #c4b5fd;
    background: #f5f3ff;
    color: #5b21b6;
    font-weight: 800;
    font-size: 11pt;
}

#ciem_f12_shell .ciem-f12-export {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 2px solid #e9d5ff;
}

#ciem_f12_shell .ciem-f12-btn-export {
    padding: 12px 18px;
    border-radius: 12px;
    border: 2px solid #7c3aed;
    background: #fff;
    color: #5b21b6;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 900;
    cursor: pointer;
}

#ciem_f12_shell .ciem-f12-btn-validar {
    padding: 14px 22px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(180deg, #c4b5fd, #7c3aed);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 1000;
    cursor: pointer;
}

#ciem_f12_alert.ciem-f12-alert {
    display: none;
    margin: 0 0 14px 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid #f59e0b;
    background: #fffbeb;
    color: #7c2d12;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-weight: 900;
}

#ciem_f12_alert.ciem-f12-alert:not(:empty) {
    display: block;
}

#ciem_f12_shell .ciem-f12-alert--jasp,
#ciem_f12_alerta_jasp.ciem-f12-alert--jasp {
    display: block;
    margin: 18px 0 0 0;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid #f59e0b;
    background: linear-gradient(180deg, #fffbeb, #fff7ed);
    color: #9a3412;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    line-height: 1.45;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15);
}

@media (max-width: 720px) {
    #ciem_fase1_pestanas .ciem-f12-pestanas-tabs {
        grid-template-columns: 1fr;
    }
    #ciem_f12_shell .ciem-f12-grid-campos {
        grid-template-columns: 1fr;
    }
}
