/* CREA Resource Generator - estilos base */

:root {
    --crea-ink: #14213d;
    --crea-ink-2: #1d2d52;
    --crea-accent: #2a9d8f;
    --crea-accent-2: #e9c46a;
    --crea-warm: #f4a261;
    --crea-bg: #f5f6fa;
    --crea-surface: #ffffff;
    --crea-border: #e6e8ef;
    --crea-muted: #6b7280;
    --crea-radius: 14px;
    --sidebar-width: 264px;

    --bs-primary: #1f6f8b;
    --bs-primary-rgb: 31, 111, 139;
    --bs-link-color: #1f6f8b;
    --bs-link-hover-color: #17566c;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.btn-primary {
    --bs-btn-bg: #1f6f8b;
    --bs-btn-border-color: #1f6f8b;
    --bs-btn-hover-bg: #17566c;
    --bs-btn-hover-border-color: #17566c;
    --bs-btn-active-bg: #124556;
    --bs-btn-active-border-color: #124556;
}

.min-w-0 { min-width: 0; }

/* ---------- Estructura ---------- */
.app-body { background: var(--crea-bg); }

.app-shell { display: flex; min-height: 100vh; }

.app-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1 1 auto;
    padding: 24px;
    max-width: 1400px;
    width: 100%;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 0.8rem;
    color: var(--crea-muted);
    border-top: 1px solid var(--crea-border);
    background: var(--crea-surface);
}

/* ---------- Sidebar ---------- */
.app-sidebar {
    --bs-offcanvas-width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--crea-ink) 0%, var(--crea-ink-2) 100%);
    color: #cfd6e6;
}

@media (min-width: 992px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        width: var(--sidebar-width);
        flex: 0 0 var(--sidebar-width);
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px 16px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--crea-accent), #1f6f8b);
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 6px 16px rgba(42, 157, 143, 0.35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.05rem; letter-spacing: 0.08em; }
.brand-text small { font-size: 0.72rem; color: #9fb0cf; }

.sidebar-nav { padding: 8px 12px; flex: 1 1 auto; }

.sidebar-heading {
    margin: 18px 10px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7f8fb0;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: 10px;
    color: #cfd6e6;
    font-size: 0.93rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.app-sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: 0.9; }

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.app-sidebar .nav-link.active {
    background: rgba(42, 157, 143, 0.18);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--crea-accent);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 0.75rem;
    color: #7f8fb0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---------- Topbar ---------- */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--crea-border);
}

.topbar-title { font-size: 1.1rem; font-weight: 650; margin: 0; color: var(--crea-ink); }

.btn-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 1.35rem;
    color: var(--crea-ink);
}

.btn-user {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--crea-border);
    border-radius: 999px;
    padding: 4px 12px 4px 4px;
    background: var(--crea-surface);
}

.avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e8f3f1;
    color: var(--crea-accent);
}

/* ---------- Componentes ---------- */
.card {
    border: 1px solid var(--crea-border);
    border-radius: var(--crea-radius);
    box-shadow: 0 1px 2px rgba(20, 33, 61, 0.04);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--crea-border);
    font-weight: 600;
    padding: 14px 18px;
}

.page-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    margin-bottom: 20px;
    border-radius: var(--crea-radius);
    background:
        radial-gradient(circle at 92% 20%, rgba(233, 196, 106, 0.35), transparent 40%),
        linear-gradient(120deg, #ffffff 0%, #eef7f6 100%);
    border: 1px solid var(--crea-border);
}

.eyebrow {
    margin: 0 0 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--crea-accent);
}

.page-heading { font-size: 1.45rem; font-weight: 700; color: var(--crea-ink); margin-bottom: 4px; }

.stat-card .card-body { padding: 18px; }

.stat-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.tone-primary { background: #e6f0f4; color: #1f6f8b; }
.tone-success { background: #e6f4f1; color: #2a9d8f; }
.tone-warning { background: #fdf3e2; color: #c98a1b; }
.tone-info { background: #eeeafd; color: #6553c9; }

.stat-value { font-size: 1.7rem; font-weight: 750; color: var(--crea-ink); line-height: 1.1; }
.stat-label { font-size: 0.85rem; color: var(--crea-muted); }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.empty-state > i { font-size: 2.2rem; color: #b8c0d4; margin-bottom: 8px; }

.roadmap .list-group-item { padding: 10px 18px; font-size: 0.92rem; }

.coming-soon { text-align: center; padding: 40px 12px; }
.coming-icon {
    display: inline-grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 2rem;
    background: #e8f3f1;
    color: var(--crea-accent);
}
.coming-text { max-width: 520px; }

/* ---------- Layout mínimo / errores ---------- */
.minimal-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 15%, rgba(42, 157, 143, 0.12), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(233, 196, 106, 0.2), transparent 40%),
        var(--crea-bg);
}

.minimal-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.error-card {
    width: 100%;
    max-width: 460px;
    background: var(--crea-surface);
    border: 1px solid var(--crea-border);
    border-radius: 20px;
    padding: 40px 28px;
    box-shadow: 0 12px 40px rgba(20, 33, 61, 0.08);
}

.error-icon {
    display: inline-grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 2rem;
    background: #e6f0f4;
    color: #1f6f8b;
    margin-bottom: 14px;
}

.error-code {
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--crea-muted);
}

/* ---------- Móvil ---------- */
@media (max-width: 575.98px) {
    .app-content { padding: 16px; }
    .app-topbar { padding: 10px 16px; }
    .app-footer { padding: 12px 16px; }
    .page-intro { padding: 18px 16px; }
    .page-intro .btn-lg { width: 100%; }
    .stat-value { font-size: 1.4rem; }
}

/* ---------- Instalador ---------- */
.install-wrap { max-width: 1040px; margin: 0 auto; padding: 28px 16px 48px; }
.install-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.install-brand { font-weight: 750; color: var(--crea-ink); letter-spacing: 0.02em; }
.install-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.install-steps { position: sticky; top: 20px; }
.install-step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--crea-muted); font-size: 0.93rem; }
.install-step-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #eceef4; flex: 0 0 32px; }
.install-step.is-done { color: var(--crea-ink); }
.install-step.is-done .install-step-icon { background: #e6f4f1; color: var(--crea-accent); }
.install-step.is-current { background: var(--crea-surface); color: var(--crea-ink); font-weight: 650; box-shadow: 0 1px 2px rgba(20, 33, 61, 0.06); border: 1px solid var(--crea-border); }
.install-step.is-current .install-step-icon { background: #1f6f8b; color: #fff; }
.install-steps-mobile { background: var(--crea-surface); border: 1px solid var(--crea-border); border-radius: var(--crea-radius); padding: 12px 16px; font-size: 0.9rem; }
.install-card .card-body { padding: 28px; }
.install-title { font-size: 1.35rem; font-weight: 700; color: var(--crea-ink); margin-bottom: 6px; }
.install-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--crea-border); }
.install-summary dt { font-weight: 600; color: var(--crea-muted); }
.install-summary dd { margin-bottom: 8px; }

@media (max-width: 991.98px) {
    .install-grid { grid-template-columns: 1fr; }
    .install-steps { position: static; }
}

@media (max-width: 575.98px) {
    .install-card .card-body { padding: 18px 16px; }
    .install-actions > * { flex: 1 1 100%; }
    .install-actions .btn { width: 100%; }
    .install-actions > span:empty { display: none; }
}
.progress { --bs-progress-bar-bg: #1f6f8b; }

/* ---------- Acceso y usuario ---------- */
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--crea-surface);
    border: 1px solid var(--crea-border);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: 0 12px 40px rgba(20, 33, 61, 0.08);
}
.login-title { color: var(--crea-ink); }
.brand-mark-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.6rem; }
.avatar-initials { font-size: 0.78rem; font-weight: 700; background: #1f6f8b; color: #fff; }
.user-name { max-width: 180px; font-size: 0.88rem; font-weight: 600; }
.btn-user small { font-size: 0.72rem; }
.profile-data dt { font-weight: 600; color: var(--crea-muted); }
.profile-data dd { margin-bottom: 8px; }

@media (max-width: 575.98px) {
    .login-card { padding: 28px 20px; }
}

/* ---------- Panel administrativo ---------- */
.stat-hint { font-size: 0.75rem; color: var(--crea-muted); margin-top: 2px; }
.usage-table th { font-size: 0.75rem; font-weight: 600; color: var(--crea-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.usage-bar { display: inline-block; width: calc(100% - 28px); max-width: 140px; height: 8px; border-radius: 99px; background: #eceef4; vertical-align: middle; overflow: hidden; margin-right: 6px; }
.usage-bar > span { display: block; height: 100%; background: var(--crea-accent); border-radius: 99px; min-width: 0; }
.row-muted > td { opacity: 0.6; }
.card-muted { opacity: 0.7; }
.grade-number { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; background: #e6f0f4; color: #1f6f8b; font-weight: 750; font-size: 0.9rem; }
.form-card { max-width: 860px; }
.form-card-sm { max-width: 620px; }
.role-option { padding: 10px 14px; border-radius: 12px; white-space: normal; }
.btn-check:checked + .role-option { background: #e6f0f4; color: var(--crea-ink); border-color: #1f6f8b; box-shadow: inset 0 0 0 1px #1f6f8b; }
.filters-form .form-control, .filters-form .form-select { width: auto; min-width: 140px; }
.credential-input { max-width: 360px; }
.section-chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border-radius: 10px; background: #e6f4f1; border: 1px solid #cfe9e4; }
.section-chip.is-off { background: #f1f2f5; border-color: var(--crea-border); opacity: 0.7; }
.section-letter { font-weight: 700; color: var(--crea-ink); margin-right: 4px; }
.chip-btn { border: 0; background: transparent; padding: 2px 5px; border-radius: 6px; color: var(--crea-muted); line-height: 1; }
.chip-btn:hover, .chip-btn:focus-visible { background: rgba(20, 33, 61, 0.08); color: var(--crea-ink); }
.bulk-form .form-control { width: 160px; }
.settings-tabs .nav-link { color: var(--crea-muted); border-radius: 10px; }
.settings-tabs .nav-link.active { background: #1f6f8b; color: #fff; }
.logo-preview { width: 84px; height: 84px; border-radius: 14px; border: 1px dashed var(--crea-border); display: grid; place-items: center; background: #fafbfc; overflow: hidden; font-size: 1.8rem; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: 0 0 40px; }
.brand-logo img { max-width: 36px; max-height: 36px; object-fit: contain; }
.login-logo { display: block; max-width: 120px; max-height: 80px; object-fit: contain; margin: 0 auto; }

@media (max-width: 575.98px) {
    .filters-form, .filters-form .form-control, .filters-form .form-select { width: 100%; }
    .bulk-form, .bulk-form .form-control { width: 100%; }
}

/* Color del tema en componentes de Bootstrap */
.btn-outline-primary {
    --bs-btn-color: #1f6f8b;
    --bs-btn-border-color: #1f6f8b;
    --bs-btn-hover-bg: #1f6f8b;
    --bs-btn-hover-border-color: #1f6f8b;
    --bs-btn-active-bg: #17566c;
    --bs-btn-active-border-color: #17566c;
}
.pagination { --bs-pagination-color: #1f6f8b; --bs-pagination-active-bg: #1f6f8b; --bs-pagination-active-border-color: #1f6f8b; }
.form-check-input:checked { background-color: #1f6f8b; border-color: #1f6f8b; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #7fb3c5; box-shadow: 0 0 0 0.2rem rgba(31, 111, 139, 0.18); }
.text-bg-primary { background-color: #1f6f8b !important; }
.badge.bg-success-subtle, .badge.bg-warning-subtle, .badge.bg-secondary-subtle, .badge.bg-danger-subtle { font-weight: 600; }
@media (max-width: 575.98px) {
    .table td, .table th { padding-left: 0.6rem; padding-right: 0.6rem; }
}
/* Botón "ver contraseña": mismo borde que el campo */
.input-group > [data-toggle-password] { border-color: var(--bs-border-color); color: var(--crea-muted); background: #fff; }
.input-group > [data-toggle-password]:hover, .input-group > [data-toggle-password]:focus-visible { background: #f1f4f8; color: var(--crea-ink); }

/* ---------- Contenido pedagógico ---------- */
.collection-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 18px 20px; border-radius: var(--crea-radius); background: var(--crea-surface); border: 1px solid var(--crea-border); }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.library-unit { padding: 14px 18px; border-top: 1px solid var(--crea-border); }
.library-unit:first-of-type { border-top: 0; }
.session-list li + li { margin-top: 4px; }
.session-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; border: 1px solid transparent; }
.session-link:hover, .session-link:focus-visible { background: #f4f8fa; border-color: var(--crea-border); }
.session-number { display: inline-grid; place-items: center; min-width: 36px; height: 28px; border-radius: 8px; background: #fdf3e2; color: #a86e10; font-weight: 700; font-size: 0.82rem; }
.tool-badge { background: #e6f4f1; color: #1d6b61; font-weight: 600; }
.media-badge { background: #eeeafd; color: #4d3fae; font-weight: 600; }
.question-badge { background: #e6f0f4; color: #1f6f8b; font-weight: 600; font-size: 0.68rem; vertical-align: middle; }
.field-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--crea-muted); margin-bottom: 4px; }
.script-list { list-style: none; counter-reset: paso; margin: 0; padding: 12px 18px; }
.script-step { counter-increment: paso; position: relative; padding: 8px 0 8px 36px; border-bottom: 1px dashed var(--crea-border); }
.script-step:last-child { border-bottom: 0; }
.script-step::before { content: counter(paso); position: absolute; left: 0; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: #eceef4; color: var(--crea-muted); font-size: 0.72rem; font-weight: 700; display: grid; place-items: center; }
.script-step.is-acotacion { color: var(--crea-muted); font-size: 0.92rem; }
.script-step.is-question::before { background: #1f6f8b; color: #fff; }
.quote-block { border-left: 4px solid var(--crea-accent-2); background: #fffaf0; padding: 10px 14px; border-radius: 0 10px 10px 0; font-style: italic; }
.quote-block mark { background: #fbe7b0; padding: 0 2px; border-radius: 3px; font-style: normal; }
.media-item { padding: 14px 18px; border-top: 1px solid var(--crea-border); }
.media-item:first-of-type { border-top: 0; }
.prompt-box + .prompt-box { margin-top: 8px; }
.prompt-text { font-size: 0.82rem; background: #fafbfc; resize: vertical; }

/* Editor */
.editor-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.editor-nav { position: sticky; top: 84px; }
.editor-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--crea-muted); text-decoration: none; font-size: 0.9rem; }
.editor-nav a:hover { background: var(--crea-surface); color: var(--crea-ink); }
.repeater-row { padding: 8px; border-radius: 10px; border: 1px solid var(--crea-border); background: #fcfcfd; margin-bottom: 8px; }
.media-row { padding: 12px; }
.step-row.is-acotacion { background: #f6f7f9; }
.step-row.is-acotacion textarea { font-style: italic; color: var(--crea-muted); }
.step-type { width: 120px; flex: 0 0 120px; }
.row-actions .btn { padding: 2px 7px; }
textarea[data-autosize] { overflow: hidden; resize: vertical; min-height: 38px; }
.editor-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 0; background: linear-gradient(180deg, rgba(245, 246, 250, 0) 0%, var(--crea-bg) 35%); }

@media (max-width: 1199.98px) {
    .editor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .library-grid { grid-template-columns: 1fr; }
    .step-row > .d-flex { flex-wrap: wrap; }
    .step-type { width: 100%; flex-basis: 100%; }
}
.session-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }

/* ---------- Importador ---------- */
.import-option.is-featured { border-color: #bfe3dc; background: linear-gradient(135deg, #ffffff 0%, #f1faf8 100%); }
.import-count { min-width: 92px; padding: 8px 12px; border-radius: 12px; background: #f1f2f5; text-align: center; line-height: 1.1; }
.import-count strong { display: block; font-size: 1.5rem; color: var(--crea-ink); }
.import-count span { font-size: 0.75rem; color: var(--crea-muted); }
.import-count.tone-success { background: #e6f4f1; }
.import-count.tone-primary { background: #e6f0f4; }

/* ---------------------------------------------------------------
   Generar recursos (Fase 7)
   --------------------------------------------------------------- */
.gen-step-number {
    display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 6px;
    border-radius: 8px; background: #1f6f8b; color: #fff; font-size: 0.8rem; font-weight: 700;
}
.gen-summary { border-left: 3px solid var(--crea-accent); padding: 8px 12px; background: #f6faf9; border-radius: 0 10px 10px 0; }
.gen-resource, .gen-mode {
    display: flex; gap: 10px; align-items: flex-start; height: 100%; padding: 12px;
    border: 1px solid var(--crea-border); border-radius: 12px; cursor: pointer; background: var(--crea-surface);
    transition: border-color .15s, background-color .15s;
}
.gen-resource:hover, .gen-mode:hover { border-color: #9cc3d0; }
.gen-resource:has(input:checked), .gen-mode:has(input:checked) { border-color: #1f6f8b; background: #f1f7f9; }
.gen-resource .form-check-input, .gen-mode .form-check-input { margin-top: 3px; flex: 0 0 auto; }
.gen-resource-icon { font-size: 1.2rem; color: #1f6f8b; }
.gen-mode.is-disabled { cursor: not-allowed; opacity: .65; background: #f7f8fb; }
.gen-nav { position: sticky; top: 76px; }
.gen-nav .list-group-item.active { background: #1f6f8b; border-color: #1f6f8b; }

/* Diapositivas */
.slide-card { height: 100%; display: flex; flex-direction: column; gap: 6px; }
.slide-frame {
    position: relative; aspect-ratio: 16 / 9; overflow: hidden; padding: 18px 20px 26px;
    border: 1px solid var(--crea-border); border-radius: 12px; background: #fff;
    border-top: 6px solid #2a9d8f; box-shadow: 0 1px 2px rgba(20, 33, 61, .06);
}
.slide-card.is-cover .slide-frame { background: #14213d; color: #fff; border-top-color: #e9c46a; display: flex; flex-direction: column; justify-content: center; }
.slide-card.is-cover .slide-title { color: #fff; font-size: 1.25rem; }
.slide-card.is-cover .slide-subtitle, .slide-card.is-cover .slide-text, .slide-card.is-cover .slide-points { color: #d8deea; }
.slide-card.is-pending .slide-frame { border-style: dashed; border-top-style: solid; border-top-color: #e9c46a; }
.slide-number { position: absolute; top: 8px; right: 12px; font-size: .72rem; color: var(--crea-muted); font-weight: 700; }
.slide-title { font-size: 1.02rem; font-weight: 750; color: #14213d; margin: 0 28px 4px 0; }
.slide-subtitle { font-size: .8rem; color: #2a9d8f; font-weight: 600; margin-bottom: 6px; }
.slide-text { font-size: .8rem; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.slide-text.is-quote { -webkit-line-clamp: 4; font-style: italic; border-left: 3px solid #e9c46a; padding-left: 8px; }
.slide-points { font-size: .78rem; padding-left: 18px; margin: 0; }
.slide-points li { margin-bottom: 2px; }
.slide-image-flag { position: absolute; right: 12px; bottom: 24px; font-size: .7rem; background: #eef6f4; color: #1d6f65; padding: 2px 8px; border-radius: 99px; }
.slide-footer { position: absolute; left: 20px; right: 20px; bottom: 6px; font-size: .62rem; color: var(--crea-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-meta { display: flex; gap: 8px; align-items: center; }
.slide-note { font-size: .78rem; color: var(--crea-muted); margin: 0; }

/* Documentos */
.doc-preview .card-body { padding: 28px 32px; }
.doc-header { border-bottom: 2px solid #14213d; padding-bottom: 12px; margin-bottom: 16px; }
.doc-title { font-weight: 750; color: #14213d; margin-bottom: 2px; }
.doc-subtitle { color: var(--crea-muted); margin-bottom: 8px; }
.doc-fields { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .88rem; }
.doc-field { display: inline-flex; align-items: flex-end; gap: 6px; }
.doc-blank { display: inline-block; width: 150px; border-bottom: 1px solid #9aa3b5; height: 1em; }
.doc-section { margin-bottom: 18px; }
.doc-section-title { font-size: 1rem; font-weight: 700; color: #1f6f8b; border-bottom: 1px solid var(--crea-border); padding-bottom: 4px; margin-bottom: 10px; }
.doc-label { font-weight: 600; font-size: .85rem; color: var(--crea-muted); margin-bottom: 4px; }
.doc-list { padding-left: 20px; }
.doc-box { border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; background: #f1f7f9; border-left: 4px solid #1f6f8b; }
.doc-box.is-concepto { background: #f6faf9; border-left-color: #2a9d8f; }
.doc-box.is-pendiente { background: #fdf8ec; border-left-color: #e9c46a; }
.doc-box-title { font-weight: 700; margin-bottom: 4px; }
.doc-questions { padding-left: 22px; }
.doc-questions > li { margin-bottom: 12px; }
.doc-question { display: block; margin-bottom: 4px; }
.doc-line { display: block; height: 26px; border-bottom: 1px solid #c5cbd8; }
.doc-options { padding-left: 22px; font-size: .92rem; }
.doc-options .is-answer::marker { color: #2a9d8f; font-weight: 700; }
.doc-tf, .doc-answer { font-size: .85rem; }
.doc-answer { color: #2a9d8f; margin-left: 8px; }
.doc-scale { display: flex; flex-wrap: wrap; gap: 16px; font-size: .9rem; }
.doc-scale-option { display: inline-flex; gap: 6px; align-items: center; }
.doc-check { display: inline-block; width: 14px; height: 14px; border: 1px solid #8f98ab; border-radius: 3px; }
.doc-table { font-size: .85rem; }
.doc-checklist th, .doc-checklist td { text-align: center; vertical-align: middle; min-width: 34px; }
.doc-checklist .doc-student { min-width: 180px; }
.doc-checklist .doc-level { font-size: .68rem; font-weight: 600; }
.doc-key { background: #f7f8fb; border-radius: 10px; padding: 12px 16px; }
.doc-script { margin-bottom: 0; }
.prompt-box { font-size: .82rem; background: #f7f8fb; }
@media (max-width: 575.98px) { .doc-preview .card-body { padding: 18px; } .gen-nav { position: static; } }

/* ---------------------------------------------------------------
   Configuración IA (Fase 8)
   --------------------------------------------------------------- */
.ai-test.is-ok { border-left: 4px solid #2a9d8f; }
.ai-test.is-error { border-left: 4px solid #dc3545; }
.ai-response { background: #f7f8fb; border-radius: 8px; padding: 8px 10px; font-size: .8rem; white-space: pre-wrap; word-break: break-word; }
.ai-chain { padding-left: 20px; }
.ai-chain li { margin-bottom: 4px; }
.ai-chain li .badge { margin-left: 4px; }
.ai-table th { font-size: .75rem; font-weight: 600; color: var(--crea-muted); text-transform: uppercase; letter-spacing: .04em; }
.ai-detail { max-width: 340px; word-break: break-word; }
.ai-provider-data dt { font-weight: 600; color: var(--crea-muted); }
.ai-provider-data dd { margin-bottom: 4px; }

/* ---------------------------------------------------------------
   Motor de IA (Fase 9)
   --------------------------------------------------------------- */
.bg-ia { background-color: #6553c9 !important; }
.gen-progress { border-left: 4px solid #6553c9; }
.gen-progress .progress { --bs-progress-bar-bg: #6553c9; height: 10px; }
.prompt-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.5; }

/* ---------------------------------------------------------------
   Plantillas (Fase 10)
   --------------------------------------------------------------- */
.template-card.is-inactive { opacity: .7; }
.template-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; background: #f3f4f8; border-bottom: 1px solid var(--crea-border); border-radius: 14px 14px 0 0; }
.template-preview > div { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 2px rgba(20, 33, 61, .12); }
.tp-cover { background: var(--tp-primary); }
.tp-cover .tp-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tp-accent); }
.tp-cover .tp-title { position: absolute; left: 14%; top: 38%; width: 62%; height: 12%; background: #fff; border-radius: 2px; }
.tp-cover .tp-sub { position: absolute; left: 14%; top: 56%; width: 34%; height: 7%; background: var(--tp-accent); border-radius: 2px; }
.tp-slide { background: var(--tp-bg); }
.tp-slide .tp-band { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--tp-secondary); }
.tp-slide .tp-h { position: absolute; left: 8%; top: 16%; width: 50%; height: 11%; background: var(--tp-primary); border-radius: 2px; }
.tp-slide .tp-line { position: absolute; left: 8%; top: 40%; width: 80%; height: 6%; background: var(--tp-text); opacity: .35; border-radius: 2px; }
.tp-slide .tp-line.short { top: 54%; width: 58%; }
.slide-rows { counter-reset: diapositiva; }
.slide-row { counter-increment: diapositiva; display: grid; grid-template-columns: 26px minmax(0, 1.25fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.slide-row-number::before { content: counter(diapositiva); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #eceef4; font-size: .72rem; font-weight: 700; color: var(--crea-muted); }
@media (max-width: 575.98px) { .slide-row { grid-template-columns: 26px 1fr; } .slide-row > input, .slide-row > .btn-group { grid-column: 2; } }

/* Editor de recursos (Fase 14) */
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color); }
.edit-block { border-color: var(--bs-border-color) !important; }

/* Imágenes de los recursos (Fase 17) */
.image-tools { padding: 0 2px; }
.image-thumb img { display: block; width: 100%; max-height: 180px; object-fit: contain; background: var(--bs-tertiary-bg); border-radius: .5rem; border: 1px solid var(--bs-border-color); }
.image-actions summary { cursor: pointer; color: var(--bs-link-color); list-style: none; }
.image-actions summary::-webkit-details-marker { display: none; }
.slide-image-flag.has-image { background: #e7f5ec; color: #1f7a45; }

/* Auditoría y registros (Fase 18) */
.audit-data { max-width: 32rem; max-height: 14rem; overflow: auto; font-size: .75rem; background: var(--bs-tertiary-bg); padding: .5rem; border-radius: .375rem; white-space: pre-wrap; word-break: break-word; }
.log-view { max-height: 70vh; overflow: auto; font-size: .75rem; padding: .75rem 1rem; background: #0f172a; color: #e2e8f0; border-radius: 0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius); white-space: pre-wrap; word-break: break-word; }
.log-view .log-error { color: #fca5a5; }
.log-view .log-warning { color: #fcd34d; }
.security-check { display: flex; gap: .75rem; align-items: flex-start; }
.security-check .bi { font-size: 1.1rem; margin-top: .1rem; }
