/* ==========================================================================
   DASHBOARD PRO WORKSTATION STYLESHEET - LA CUEVA DEL GÜERO
   admin.lacuevadelguero.com
   Optimizaciones para Pantallas Grandes (Desktop / Ultrawide)
   Arquitectura Coexistente: 100% Mobile-First y Soporte iPhone Duo Preservado
   ========================================================================== */

/* Variables y Tokens de Diseño Pro */
:root {
    --ws-bg-base: #06060c;
    --ws-bg-card: rgba(14, 14, 24, 0.82);
    --ws-bg-card-hover: rgba(20, 20, 34, 0.92);
    --ws-cyan-glow: 0 0 15px rgba(0, 255, 255, 0.25);
    --ws-magenta-glow: 0 0 15px rgba(255, 0, 255, 0.25);
    --ws-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Garantía universal de scroll táctil y de ratón en el Visor de Documentos / Contratos de La Mary (todas las resoluciones, incluido 993px-1199px) */
.episodios-layout,
#view-documentos.active,
#view-finanzas.active {
    min-height: 0 !important;
}

.subpanel-detalle,
#doc-subpanel-detalle,
.subpanel-lista {
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
}

/* ==========================================================================
   REGLAS DESKTOP Y PANTALLAS GRANDES (>= 1200px)
   ========================================================================== */
@media (min-width: 1200px) {

    /* --- 1. NAVBAR / HEADER OPTIMIZADO --- */
    header,
    .dashboard-header {
        padding: 14px 36px !important;
        background: rgba(8, 8, 16, 0.94) !important;
        border-bottom: 1px solid rgba(0, 255, 255, 0.2) !important;
        backdrop-filter: blur(14px) !important;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5) !important;
        min-height: 68px;
        box-sizing: border-box;
    }

    .header-brand-wrap {
        display: flex !important;
        align-items: center !important;
        gap: 16px !important;
    }

    #view-header-title {
        font-size: clamp(1.2rem, 1.35vw, 1.55rem) !important;
        font-weight: 800 !important;
        letter-spacing: 0.5px !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    .desktop-workstation-badge {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 4px 12px !important;
        font-size: 0.72rem !important;
        font-weight: 800 !important;
        letter-spacing: 1px !important;
        color: var(--neon-cyan) !important;
        background: rgba(0, 255, 255, 0.08) !important;
        border: 1px solid rgba(0, 255, 255, 0.35) !important;
        border-radius: 20px !important;
        text-shadow: 0 0 8px rgba(0, 255, 255, 0.4) !important;
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.1) !important;
        text-transform: uppercase;
    }

    .header-actions-bar {
        display: flex !important;
        gap: 10px !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    .header-actions-bar .btn-neon {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        min-height: 36px !important;
        min-width: auto !important;
        padding: 6px 13px !important;
        font-size: 0.78rem !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        transition: var(--ws-transition) !important;
        background: rgba(10, 10, 18, 0.6) !important;
        backdrop-filter: blur(8px) !important;
    }

    .header-actions-bar .btn-neon:hover {
        transform: translateY(-2px) !important;
    }

    .admin-badge {
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 6px 14px !important;
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        background: rgba(0, 255, 255, 0.08) !important;
        border: 1px solid var(--neon-cyan) !important;
        border-radius: 20px !important;
        white-space: nowrap !important;
        letter-spacing: 0.5px;
    }

    .admin-badge::before {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #39FF14;
        box-shadow: 0 0 8px #39FF14, 0 0 15px rgba(57, 255, 20, 0.6);
        display: inline-block;
        animation: pulseLiveDot 2s infinite ease-in-out;
    }

    @keyframes pulseLiveDot {
        0%, 100% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.6; transform: scale(0.85); }
    }

    /* --- 2. CONTENEDOR PRINCIPAL Y VISTAS --- */
    .view-section {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px 32px !important;
        height: calc(100vh - 66px) !important;
        box-sizing: border-box !important;
    }

    .view-section.active {
        display: flex !important;
        flex-direction: column !important;
    }

    /* --- 3. DISTRIBUCIÓN UNIFICADA DE MÓDULOS (.episodios-layout) --- */
    .episodios-layout,
    .canva-editor-workspace {
        display: flex !important;
        flex-direction: row !important;
        gap: 24px !important;
        flex: 1 !important;
        min-height: 0 !important;
        height: calc(100% - 58px) !important;
        align-items: stretch !important;
    }

    /* Panel izquierdo fijo y ergonómico en desktop (360px) */
    .subpanel-lista {
        width: 360px !important;
        min-width: 340px !important;
        max-width: 380px !important;
        flex-shrink: 0 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        border: 1px solid rgba(0, 255, 255, 0.25) !important;
        background: rgba(12, 12, 22, 0.85) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
    }

    /* Panel derecho expandido con el resto del viewport (flex: 1) */
    .subpanel-detalle {
        flex: 1 !important;
        width: auto !important;
        max-width: calc(100% - 384px) !important;
        height: 100% !important;
        overflow-y: auto !important;
        padding: 24px 30px !important;
        border: 1px solid rgba(255, 0, 255, 0.25) !important;
        background: rgba(12, 12, 22, 0.85) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
    }

    .subpanel-lista > *,
    .subpanel-detalle > * {
        flex-shrink: 0 !important;
    }

    /* Modo Lectura / Ampliar Vista en Documentos Oficiales */
    #view-documentos.docs-focus-mode .subpanel-lista {
        display: none !important;
    }

    #view-documentos.docs-focus-mode .subpanel-detalle {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Criterios de curaduría (33 preguntas) en grid multirrenglón armonioso */
    #ponderacion-criterios {
        grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)) !important;
        gap: 12px !important;
        max-height: 480px !important;
    }

    /* --- 4. EDITOR CANVA PRO (#view-canva) --- */
    .canva-viewport-card {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        background: 
            radial-gradient(circle at center, rgba(16, 16, 30, 0.9) 0%, rgba(6, 6, 12, 0.98) 100%) !important;
        border: 1px solid rgba(0, 255, 255, 0.25) !important;
        border-radius: 16px !important;
        padding: 24px !important;
        box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(0, 255, 255, 0.08) !important;
        position: relative !important;
        overflow: hidden !important;
    }

    .canva-viewport-card::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: 
            linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
        background-size: 30px 30px;
        pointer-events: none;
    }

    #canvaCanvas {
        max-width: 100% !important;
        max-height: calc(100vh - 260px) !important;
        object-fit: contain !important;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 255, 255, 0.2) !important;
        border: 1px solid rgba(0, 255, 255, 0.3) !important;
        position: relative;
        z-index: 2;
    }

    /* --- 5. EDITOR DE VIDEO (#view-video) --- */
    .video-timeline-card {
        background: #0d0d16 !important;
        border: 1px solid rgba(0, 255, 255, 0.2) !important;
        border-radius: 14px !important;
        padding: 16px 20px !important;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5) !important;
    }

    #timeline-tracks-wrapper {
        min-height: 155px !important;
        gap: 10px !important;
    }

    /* --- 6. HOOKS Y BLOG (#view-hooks, #view-blog) --- */
    .hooks-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
        gap: 20px !important;
    }

    #blog-content {
        min-height: 320px !important;
        font-size: 0.96rem !important;
        line-height: 1.65 !important;
    }
}

/* ==========================================================================
   OPTIMIZACIONES ULTRA-WIDE & MONITOR PRO (>= 1600px)
   ========================================================================== */
@media (min-width: 1600px) {
    .subpanel-lista {
        width: 390px !important;
        max-width: 410px !important;
    }

    .subpanel-detalle {
        max-width: calc(100% - 414px) !important;
        padding: 28px 38px !important;
    }

    #canvaCanvas {
        max-height: calc(100vh - 240px) !important;
    }

    /* Hooks: Distribución 3 columnas perfectas */
    .hooks-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 24px !important;
    }
}

/* ==========================================================================
   NUEVA ARQUITECTURA UI/UX DASHBOARD PRO (REDESIGN COMPLETO)
   - Cabecera Estática Fija con "La Cueva del Güero Pro"
   - Menú Hamburguesa Desplegable Ajustado a la Pantalla (Drawer Offcanvas)
   - Hub de Tarjetas Flotantes Magnéticas con Luz Neón Cyan
   - Navegación con Flecha Volver en Todo Momento
   - Modales Translúcidos Glassmorphism
   ========================================================================== */

/* 1. Reset de layout: El contenido principal toma 100% de ancho */
body {
    display: block !important;
    width: 100% !important;
    overflow-x: hidden;
}

.main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.responsive-2col-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .episodios-layout,
    .canva-editor-workspace {
        flex-direction: column !important;
        display: flex !important;
        height: auto !important;
        gap: 16px !important;
    }
    .subpanel-lista,
    .subpanel-detalle {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }
    .responsive-2col-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
}

/* 2. Menú Hamburguesa Desplegable (Drawer Offcanvas) */
.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 330px !important;
    max-width: 88vw !important;
    height: 100vh !important;
    z-index: 2500 !important;
    transform: translateX(-105%) !important;
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.38s ease !important;
    background: rgba(9, 9, 18, 0.96) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    border-right: 1px solid rgba(0, 255, 255, 0.3) !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
}

.sidebar.active {
    transform: translateX(0) !important;
    box-shadow: 15px 0 60px rgba(0, 255, 255, 0.22), 0 0 120px rgba(0, 0, 0, 0.95) !important;
}

/* Overlay oscuro con blur para cerrar el menú */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 8, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2490;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Botón cerrar dentro del Drawer */
.sidebar-close-btn {
    position: absolute;
    top: 22px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    color: var(--neon-cyan);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
    background: var(--neon-cyan);
    color: #000;
    transform: rotate(90deg);
    box-shadow: 0 0 15px var(--neon-cyan);
}

/* 3. Cabecera Estática Fija */
header.dashboard-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 2000 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 28px !important;
    background: rgba(6, 6, 14, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(0, 255, 255, 0.22) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7), 0 1px 15px rgba(0, 255, 255, 0.08) !important;
    box-sizing: border-box !important;
    min-height: 66px !important;
}

.header-left-cluster {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Botón Hamburguesa Cyberpunk */
.btn-hamburger {
    background: rgba(0, 255, 255, 0.06);
    border: 1px solid rgba(0, 255, 255, 0.35);
    color: var(--neon-cyan);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
}

.btn-hamburger:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Flecha para Volver en Todo Momento (Cabecera) */
.btn-header-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 0, 255, 0.08);
    border: 1px solid rgba(255, 0, 255, 0.4);
    color: #ff80ff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.1);
}

.btn-header-back:hover {
    background: var(--neon-magenta);
    color: #fff;
    border-color: var(--neon-magenta);
    box-shadow: 0 0 18px rgba(255, 0, 255, 0.5);
    transform: translateX(-3px);
}

.btn-header-back.hidden {
    display: none !important;
}

/* Título Estático Permanente de la Cabecera */
.header-static-title {
    margin: 0;
    font-size: clamp(1.12rem, 1.35vw, 1.4rem);
    font-weight: 900;
    letter-spacing: 0.6px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    line-height: 1.15;
    white-space: nowrap;
}

.header-title-brand-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.header-static-title .badge-pro {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    color: #000;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 14px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.4);
}

.header-active-view-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--neon-cyan);
    opacity: 0.92;
    padding-left: 0;
    border-left: none;
    display: block;
    line-height: 1.1;
}

/* 4. HUB DE TARJETAS FLOTANTES MAGNÉTICAS */
.hub-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px 20px 60px 20px;
    box-sizing: border-box;
}

.hub-hero {
    text-align: center;
    margin-bottom: 35px;
    position: relative;
}

.hub-hero h2 {
    font-size: clamp(1.6rem, 2.2vw, 2.4rem);
    font-weight: 800;
    margin: 0 0 10px 0;
    color: #fff;
    letter-spacing: 0.5px;
}

.hub-hero h2 span {
    color: var(--neon-cyan);
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.hub-hero p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0 auto;
    max-width: 680px;
}

/* Grid de tarjetas magnéticas */
.magnetic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    perspective: 1200px;
}

/* Tarjeta Flotante Magnética con Sensibilidad de Luz Cyan */
.magnetic-card {
    position: relative;
    background: rgba(12, 12, 24, 0.82);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 255, 255, 0.18);
    border-radius: 18px;
    padding: 28px 24px 24px 24px;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 230px;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1);
    transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1), 
                box-shadow 0.25s ease, 
                border-color 0.25s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    will-change: transform;
}

/* Capa de luz reactiva (Sensibilidad Cyan al contacto con el mouse) */
.magnetic-card .card-spotlight {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(
        420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(0, 255, 255, 0.25),
        transparent 65%
    );
    mix-blend-mode: screen;
    z-index: 1;
}

.magnetic-card:hover {
    border-color: rgba(0, 255, 255, 0.85);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 
                0 0 35px rgba(0, 255, 255, 0.35);
}

.magnetic-card:hover .card-spotlight {
    opacity: 1;
}

/* Contenido de la tarjeta flotante */
.card-content-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.card-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(0, 255, 255, 0.08);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.magnetic-card:hover .card-icon-box {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
    transform: scale(1.08) translateZ(15px);
}

.card-tag {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #bbb;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px 0;
    transition: color 0.2s ease;
}

.magnetic-card:hover .card-title {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

.card-description {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.card-footer-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neon-cyan);
}

.card-footer-action i {
    transition: transform 0.25s ease;
}

.magnetic-card:hover .card-footer-action i {
    transform: translateX(6px);
}

/* 5. Barra de Retorno Superior en cada Sub-sección */
.section-return-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px 18px;
    background: rgba(10, 10, 20, 0.65);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.btn-section-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 7px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-section-back:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 15px var(--neon-cyan);
    transform: translateX(-3px);
}

/* 6. Modales Translúcidos Glassmorphism */
.modal-translucent-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 10, 0.8);
    backdrop-filter: blur(20px) saturate(160%);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-translucent-card {
    background: rgba(12, 12, 24, 0.92);
    border: 1px solid rgba(0, 255, 255, 0.35);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 255, 255, 0.18);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    box-sizing: border-box;
    position: relative;
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-modal-close:hover {
    background: #ff4d4d;
    border-color: #ff4d4d;
    color: #fff;
}

/* ==========================================================================
   7. MÓDULO GENERADOR DE DOCUMENTOS OFICIALES, REPORTES, VERSIONES Y PDFS
   Estandarizado bajo la arquitectura visual La Cueva del Güero v2.5 PRO
   ========================================================================== */
.docs-workstation-layout {
    display: grid;
    grid-template-columns: 430px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding-bottom: 40px;
}

@media (max-width: 1180px) {
    .docs-workstation-layout {
        grid-template-columns: 1fr;
    }
}

.docs-control-panel {
    background: rgba(12, 12, 22, 0.92);
    border: 1px solid rgba(0, 255, 255, 0.25);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* BÓVEDA DE BASE DE DATOS DE DOCUMENTOS: TABLA Y FILAS RESPONSIVE SIN EMPALMES */
.doc-db-table-wrapper {
    max-height: 280px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(0, 255, 255, 0.25);
    border-radius: 10px;
    background: #07070e;
    width: 100%;
    box-sizing: border-box;
}

.doc-db-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.8rem;
    table-layout: auto;
}

.doc-db-table thead {
    position: sticky;
    top: 0;
    background: #121226;
    z-index: 3;
}

.doc-db-table th {
    padding: 10px 12px;
    color: var(--neon-cyan);
    border-bottom: 1px solid rgba(0, 255, 255, 0.35);
    text-align: left;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.doc-db-table td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
    line-height: 1.45;
    color: #e6e6f0;
    word-break: break-word;
}

.doc-db-table tbody tr {
    transition: background 0.18s ease;
}

.doc-db-table tbody tr:hover {
    background: rgba(0, 255, 255, 0.05);
}

.doc-db-badge {
    display: inline-block;
    line-height: 1.38;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    text-align: left;
    max-width: 100%;
    box-sizing: border-box;
}

/* ÁREA DE VISUALIZACIÓN DE DOCUMENTOS OFICIALES (NUNCA SE COMPRIME EN FLEXBOX) */
.docs-preview-wrapper {
    background: #07070e;
    border: 1px solid rgba(255, 0, 255, 0.3);
    border-radius: 16px;
    padding: clamp(12px, 2vw, 24px);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.85);
    flex-shrink: 0 !important;
    width: 100%;
    max-width: 100%;
    height: auto !important;
    min-height: 620px;
    overflow: visible !important;
    box-sizing: border-box;
}

.docs-snippet-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-doc-snippet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(0, 255, 255, 0.07);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-doc-snippet:hover {
    background: #00ffff;
    color: #000;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

/* ESTÁNDAR OFICIAL DE DOCUMENTOS LA CUEVA DEL GÜERO v2.5 PRO (100% RESPONSIVE) */
.official-doc-standard {
    --bg-dark: #07070e;
    --bg-card: #10101e;
    --neon-cyan: #00ffff;
    --neon-magenta: #ff00ff;
    --neon-gold: #ffd700;
    --neon-green: #39ff14;
    --text-main: #f0f0f5;
    --text-muted: #9a9ab0;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1.55;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.official-doc-standard .btn-print {
    background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan));
    color: #000;
    font-weight: 800;
    border: none;
    padding: 11px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.official-doc-standard .btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.6);
}

.official-doc-standard .report-container {
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 2px solid rgba(0, 255, 255, 0.35);
    border-radius: 14px;
    padding: clamp(16px, 2.8vw, 42px);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.85);
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.official-doc-standard .header-banner {
    border-bottom: 2px solid var(--neon-magenta);
    padding-bottom: 20px;
    margin-bottom: 26px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
}

.official-doc-standard .header-banner > div:first-child {
    flex: 1 1 320px;
    min-width: 0;
}

.official-doc-standard .header-banner h1 {
    margin: 0;
    font-size: clamp(1.25rem, 2.1vw, 2rem);
    line-height: 1.28;
    font-weight: 800;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    letter-spacing: 0.5px;
    word-break: break-word;
}

.official-doc-standard .header-banner h1 span {
    color: var(--neon-magenta);
}

.official-doc-standard .badge-version {
    display: inline-block;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid var(--neon-gold);
    color: var(--neon-gold);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: clamp(0.72rem, 0.85vw, 0.82rem);
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.official-doc-standard .intro-box {
    background: rgba(0, 255, 255, 0.03);
    border: 1px dashed rgba(0, 255, 255, 0.3);
    padding: clamp(14px, 1.8vw, 20px);
    border-radius: 8px;
    margin-bottom: 26px;
    font-size: clamp(0.86rem, 0.95vw, 0.95rem);
    line-height: 1.55;
    color: #d0d0e0;
    word-break: break-word;
}

.official-doc-standard h2 {
    color: var(--neon-cyan);
    font-size: clamp(1.05rem, 1.3vw, 1.25rem);
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-left: 4px solid var(--neon-magenta);
    padding-left: 12px;
    margin-top: 30px;
    margin-bottom: 14px;
    page-break-after: avoid;
    word-break: break-word;
}

.official-doc-standard h3 {
    color: var(--neon-gold);
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.35;
    text-transform: uppercase;
    margin-top: 18px;
    margin-bottom: 8px;
    word-break: break-word;
}

.official-doc-standard .ascii-box {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: clamp(10px, 1.5vw, 15px);
    border-radius: 8px;
    font-family: monospace;
    font-size: clamp(0.68rem, 0.8vw, 0.78rem);
    color: var(--neon-green);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: pre;
    line-height: 1.25;
    margin: 18px 0;
    max-width: 100%;
    box-sizing: border-box;
}

.official-doc-standard .team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 26px;
}

.official-doc-standard .team-card {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: clamp(14px, 1.6vw, 18px);
    box-sizing: border-box;
    min-width: 0;
}

.official-doc-standard .team-card.principal {
    border-color: var(--neon-gold);
    grid-column: 1 / -1;
    background: rgba(255, 215, 0, 0.06);
}

.official-doc-standard .team-card h3 {
    margin: 0 0 4px 0;
    color: var(--neon-gold);
    font-size: 1.06rem;
}

.official-doc-standard .team-card .role {
    color: var(--neon-magenta);
    font-size: 0.82rem;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
    line-height: 1.35;
}

.official-doc-standard .team-card p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #ccc;
}

.official-doc-standard table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 26px;
    font-size: clamp(0.76rem, 0.88vw, 0.86rem);
    table-layout: auto;
    box-sizing: border-box;
}

.official-doc-standard th {
    background: rgba(255, 0, 255, 0.16);
    color: var(--neon-cyan);
    text-align: left;
    padding: clamp(8px, 1vw, 12px);
    border: 1px solid rgba(0, 255, 255, 0.25);
    text-transform: uppercase;
    font-size: clamp(0.7rem, 0.8vw, 0.78rem);
    letter-spacing: 0.5px;
    line-height: 1.35;
    vertical-align: middle;
}

.official-doc-standard td {
    padding: clamp(8px, 1vw, 12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ddd;
    vertical-align: middle;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.official-doc-standard tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.official-doc-standard ul,
.official-doc-standard ol {
    padding-left: 20px;
    margin: 8px 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #ddd;
}

.official-doc-standard li {
    margin-bottom: 6px;
}

.official-doc-standard code {
    display: inline-block;
    font-family: monospace;
    color: var(--neon-green);
    background: rgba(0, 0, 0, 0.38);
    padding: 2px 6px;
    margin: 1px 0;
    border-radius: 4px;
    line-height: 1.35;
    word-break: break-word;
    max-width: 100%;
}

.official-doc-standard pre {
    background: #000;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.4;
    overflow-x: auto;
    max-width: 100%;
}

.official-doc-standard .signatures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 20px;
    margin-top: 45px;
    padding-top: 20px;
    text-align: center;
}

.official-doc-standard .sig-box {
    border-top: 1px solid var(--neon-cyan);
    padding-top: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.official-doc-standard .sig-box strong {
    display: block;
    color: #fff;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.official-doc-standard .sig-box span {
    display: inline-block;
    color: var(--neon-magenta);
    font-size: 0.78rem;
    line-height: 1.35;
}

/* ADAPTACIÓN RESPONSIVE PARA TABLETS, LAPTOPS COMPACTAS Y MÓVILES */
@media (max-width: 992px) {
    .official-doc-standard table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .docs-preview-wrapper {
        padding: 12px;
        min-height: 480px;
    }

    .official-doc-standard .report-container {
        padding: 18px 14px;
    }
}

@media (max-width: 640px) {
    .doc-top-action-bar {
        padding: 12px !important;
    }

    .doc-top-action-bar .btn-neon {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }

    .official-doc-standard .header-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .official-doc-standard .signatures {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}



