        :root {
            --primary-color: #2B7A78;        /* Era #6366f1 - ahora verde teal */
            --primary-dark: #1a5a58;         /* Era #4f46e5 - verde más oscuro */
            --primary-light: #5CAB7D;        /* Era #818cf8 - verde claro */
            --secondary-color: #4E9F7E;      /* Era #8b5cf6 - verde medio */
            --bg-gradient-1: #2B7A78;        /* Fondo superior */
            --bg-gradient-2: #4E9F7E;        /* Fondo inferior */
            --success-color: #10b981;
            --error-color: #ef4444;
            --warning-color: #f59e0b;
            --text-primary: #1f2937;
            --text-secondary: #6b7280;
            --text-light: #9ca3af;
            --border-color: #e5e7eb;
            --card-bg: #ffffff;
            --input-bg: #f9fafb;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            position: relative;
            overflow-x: hidden;
        }

        /* Efectos de fondo animados */
        body::before {
            content: '';
            position: absolute;
            width: 500px;
            height: 500px;
            background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
            border-radius: 50%;
            top: -250px;
            right: -250px;
            animation: float 20s ease-in-out infinite;
        }

        body::after {
            content: '';
            position: absolute;
            width: 400px;
            height: 400px;
            background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
            border-radius: 50%;
            bottom: -200px;
            left: -200px;
            animation: float 15s ease-in-out infinite reverse;
        }

        @keyframes float {
            0%, 100% { transform: translate(0, 0) rotate(0deg); }
            33% { transform: translate(30px, -50px) rotate(120deg); }
            66% { transform: translate(-20px, 20px) rotate(240deg); }
        }
        
        .container {
            background: var(--card-bg);
            border-radius: 24px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            max-width: 1200px;
            width: 100%;
            padding: 0;
            position: relative;
            z-index: 1;
            overflow: hidden;
            animation: slideUp 0.6s ease-out;
        }

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

        .header {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            padding: 40px;
            text-align: center;
            color: white;
            position: relative;
            overflow: hidden;
        }

        .header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            animation: rotate 20s linear infinite;
        }

        @keyframes rotate {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        .header-content {
            position: relative;
            z-index: 1;
        }

        .logo {
            font-size: 48px;
            margin-bottom: 10px;
            animation: bounce 2s ease-in-out infinite;
        }

        @keyframes bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }
        
        h1 {
            font-size: 32px;
            font-weight: 700;
            margin-bottom: 8px;
            letter-spacing: -0.5px;
        }
        
        .subtitle {
            font-size: 16px;
            opacity: 0.95;
            font-weight: 400;
        }

        .content {
            padding: 40px;
        }
        
        /* Sección de autenticación mejorada */
        .auth-section {
            background: linear-gradient(to bottom, var(--input-bg), white);
            border: 2px solid var(--border-color);
            border-radius: 16px;
            padding: 40px;
            margin-bottom: 30px;
            transition: all 0.3s ease;
        }

        .auth-section:hover {
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
            transform: translateY(-2px);
        }

        .auth-section h2 {
            color: var(--text-primary);
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .auth-section > p {
            color: var(--text-secondary);
            margin-bottom: 30px;
            font-size: 15px;
        }

        /* Campo de clave de acceso */
        .access-key-group {
            margin-bottom: 25px;
        }

        .access-key-group label {
            display: block;
            margin-bottom: 10px;
            color: var(--text-primary);
            font-weight: 500;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .required-indicator {
            color: var(--error-color);
            font-weight: 600;
        }

        .input-wrapper {
            position: relative;
        }

        .access-key-input {
            width: 100%;
            padding: 14px 16px;
            padding-right: 45px;
            border: 2px solid var(--border-color);
            border-radius: 12px;
            font-family: inherit;
            font-size: 15px;
            transition: all 0.3s ease;
            background: white;
        }

        .access-key-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
        }

        .access-key-input.valid {
            border-color: var(--success-color);
            background: linear-gradient(to right, rgba(16, 185, 129, 0.05), white);
        }

        .access-key-input.invalid {
            border-color: var(--error-color);
            background: linear-gradient(to right, rgba(239, 68, 68, 0.05), white);
        }

        .toggle-password {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            cursor: pointer;
            font-size: 20px;
            padding: 4px;
            line-height: 1;
            transition: transform 0.2s ease;
        }

        .toggle-password:hover {
            transform: translateY(-50%) scale(1.1);
        }

        .key-hint {
            margin-top: 10px;
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.3s ease;
        }

        .key-hint.neutral {
            color: var(--text-secondary);
        }

        .key-hint.valid {
            color: var(--success-color);
            font-weight: 500;
        }

        .key-hint.invalid {
            color: var(--error-color);
            font-weight: 500;
        }

        /* Google Sign-In wrapper */
        .google-signin-wrapper {
            position: relative;
            transition: all 0.3s ease;
        }

        .google-signin-wrapper.disabled {
            opacity: 0.4;
            pointer-events: none;
            filter: grayscale(100%);
        }

        .google-signin-wrapper.enabled {
            opacity: 1;
            pointer-events: auto;
            animation: pulse 2s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% {
                box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
            }
            50% {
                box-shadow: 0 0 20px 10px rgba(99, 102, 241, 0);
            }
        }

        .google-signin-label {
            margin-bottom: 15px;
            font-size: 14px;
            color: var(--text-primary);
            font-weight: 500;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .google-signin-divider {
            display: flex;
            align-items: center;
            text-align: center;
            margin: 25px 0 20px;
            color: var(--text-light);
            font-size: 13px;
            font-weight: 500;
        }

        .google-signin-divider::before,
        .google-signin-divider::after {
            content: '';
            flex: 1;
            border-bottom: 1px solid var(--border-color);
        }

        .google-signin-divider:not(:empty)::before {
            margin-right: 15px;
        }

        .google-signin-divider:not(:empty)::after {
            margin-left: 15px;
        }

        /* Información de usuario */
        .user-info {
            background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 30px;
            display: none;
            align-items: center;
            gap: 20px;
            box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
            animation: slideDown 0.4s ease-out;
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .user-info.active {
            display: flex;
        }

        .user-avatar {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            border: 4px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .user-details {
            flex: 1;
            color: white;
        }

        .user-name {
            font-size: 22px;
            font-weight: 600;
            margin-bottom: 4px;
        }

        .user-email {
            font-size: 14px;
            opacity: 0.9;
        }

        .user-stats {
            display: flex;
            gap: 20px;
            margin-top: 12px;
        }

        .stat {
            display: flex;
            flex-direction: column;
            background: rgba(255, 255, 255, 0.15);
            padding: 8px 16px;
            border-radius: 8px;
            backdrop-filter: blur(10px);
        }

        .stat-label {
            font-size: 11px;
            opacity: 0.8;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .stat-value {
            font-size: 18px;
            font-weight: 600;
            margin-top: 2px;
        }

        .btn-logout {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: 2px solid rgba(255, 255, 255, 0.3);
            padding: 10px 24px;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            font-size: 14px;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
        }

        .btn-logout:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
            transform: translateY(-2px);
        }

        /* Sección de acción */
        .action-section {
            display: none;
            animation: fadeIn 0.5s ease-out;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .action-section.active {
            display: block;
        }

        .form-group {
            margin-bottom: 24px;
        }

        label {
            display: block;
            margin-bottom: 10px;
            color: var(--text-primary);
            font-weight: 500;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        textarea, select {
            width: 100%;
            padding: 14px;
            border: 2px solid var(--border-color);
            border-radius: 12px;
            font-family: inherit;
            font-size: 15px;
            transition: all 0.3s ease;
            background: var(--input-bg);
        }

        textarea {
            min-height: 140px;
            resize: vertical;
        }

        textarea:focus, select:focus {
            outline: none;
            border-color: var(--primary-color);
            background: white;
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
        }

        .btn-primary {
            width: 100%;
            padding: 16px;
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
            position: relative;
            overflow: hidden;
        }

        .btn-primary::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s ease;
        }

        .btn-primary:hover::before {
            left: 100%;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
        }

        .btn-primary:active {
            transform: translateY(0);
        }

        .btn-primary:disabled {
            background: var(--text-light);
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* Loading */
        .loading {
            display: none;
            text-align: center;
            padding: 40px;
            animation: fadeIn 0.3s ease;
        }

        .loading.active {
            display: block;
        }

        .spinner {
            width: 60px;
            height: 60px;
            margin: 0 auto 20px;
            border: 4px solid var(--border-color);
            border-top-color: var(--primary-color);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .loading-text {
            color: var(--text-secondary);
            font-size: 15px;
            font-weight: 500;
        }

        .loading-step {
            color: var(--primary-color);
            font-size: 14px;
            margin-top: 8px;
            font-weight: 600;
        }

        /* Error */
        .error {
            display: none;
            background: linear-gradient(to right, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
            border: 2px solid var(--error-color);
            color: var(--error-color);
            padding: 16px 20px;
            border-radius: 12px;
            margin-top: 20px;
            font-weight: 500;
            animation: shake 0.4s ease;
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-10px); }
            75% { transform: translateX(10px); }
        }

        .error.active {
            display: block;
        }

        /* Resultados */
        .result {
            display: none;
            margin-top: 30px;
            animation: fadeIn 0.5s ease;
        }

        .result.active {
            display: block;
        }

        .result-section {
            background: var(--input-bg);
            border: 2px solid var(--border-color);
            border-radius: 16px;
            padding: 30px;
            margin-bottom: 20px;
            transition: all 0.3s ease;
        }

        .result-section:hover {
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
            transform: translateY(-2px);
        }

        .result-section h3 {
            color: var(--primary-color);
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .result-section h4 {
            color: var(--text-primary);
            font-size: 16px;
            font-weight: 600;
            margin: 20px 0 12px 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .result-content {
            background: white;
            padding: 20px;
            border-radius: 12px;
            line-height: 1.8;
            color: var(--text-primary);
            border: 1px solid var(--border-color);
        }

        .result-content p {
            margin-bottom: 12px;
        }

        .result-content strong {
            color: var(--primary-color);
            font-weight: 600;
        }

        .result-content ul {
            margin-left: 20px;
            margin-bottom: 12px;
        }

        .result-content ol {
            margin-left: 30px;
            margin-bottom: 16px;
            padding-left: 10px;
        }

        .result-content ol li {
            margin-bottom: 12px;
            padding-left: 8px;
        }

        .result-content li {
            margin-bottom: 8px;
            line-height: 1.6;
        }

        .pictogram-image {
            width: 100%;
            max-width: 800px;
            height: auto;
            border-radius: 12px;
            margin: 20px 0;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            display: block;
            margin-left: auto;
            margin-right: auto;
        }

        .habilidades-list {
            display: grid;
            gap: 16px;
            margin-top: 20px;
        }

        .habilidad-item {
            background: white;
            padding: 16px;
            border-radius: 12px;
            border-left: 4px solid var(--primary-color);
            transition: all 0.3s ease;
        }

        .habilidad-item:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            transform: translateX(4px);
        }

        .habilidad-nombre {
            font-weight: 600;
            color: var(--primary-color);
            margin-bottom: 8px;
            font-size: 15px;
        }

        .habilidad-aplicacion {
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.6;
        }

        .context-images {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 24px;
            margin-top: 20px;
        }

        .context-image-item {
            background: white;
            padding: 20px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            transition: all 0.3s ease;
        }

        .context-image-item:hover {
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
            transform: translateY(-4px);
        }

        .context-image {
            width: 100%;
            height: auto;
            border-radius: 8px;
            margin-bottom: 16px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }

        .context-explanation {
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.6;
            padding-top: 12px;
            border-top: 2px solid var(--border-color);
        }

        .context-explanation strong {
            color: var(--text-primary);
            display: block;
            margin-bottom: 6px;
        }

        .result-tokens {
            text-align: center;
            color: var(--text-light);
            font-size: 13px;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid var(--border-color);
        }

        /* Responsive */
        @media (max-width: 768px) {
            .container {
                border-radius: 16px;
                margin: 10px;
            }

            .header {
                padding: 30px 20px;
            }

            h1 {
                font-size: 24px;
            }

            .content {
                padding: 24px;
            }

            .user-info {
                flex-direction: column;
                text-align: center;
            }

            .user-stats {
                justify-content: center;
                width: 100%;
            }

            .context-images {
                grid-template-columns: 1fr;
            }
        }

    /* ============================================
       ESTILOS PARA SISTEMA DE PESTAÑAS
       ============================================ */

    /* Contenedor de pestañas */
    .tabs-container {
        margin: 30px 0;
        display: none; /* Oculto por defecto, se muestra al autenticar */
    }

    .tabs-container.active {
        display: block;
        animation: fadeIn 0.5s ease-out;
    }

    /* Navegación de pestañas */
    .tabs-nav {
        display: flex;
        gap: 8px;
        border-bottom: 2px solid var(--border-color);
        margin-bottom: 30px;
    }

    .tab-button {
        padding: 14px 28px;
        background: transparent;
        border: none;
        border-bottom: 3px solid transparent;
        color: var(--text-secondary);
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        bottom: -2px;
    }

    .tab-button:hover {
        color: var(--primary-color);
        background: rgba(43, 122, 120, 0.05);
    }

    .tab-button.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

    /* Contenido de cada pestaña */
    .tab-content {
        display: none;
        animation: fadeIn 0.4s ease-out;
    }

    .tab-content.active {
        display: block;
    }

    /* Estilos específicos para la pestaña de Historial */
    .historial-header {
        text-align: center;
        margin-bottom: 30px;
    }

    .historial-header h2 {
        color: var(--text-primary);
        font-size: 24px;
        font-weight: 700;
        margin-bottom: 8px;
    }

    .historial-header p {
        color: var(--text-secondary);
        font-size: 16px;
    }

    .historial-card {
        background: var(--input-bg);
        border: 2px solid var(--border-color);
        border-radius: 16px;
        padding: 30px;
        transition: all 0.3s ease;
    }

    .historial-card:hover {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }

    .historial-controls {
        display: flex;
        gap: 12px;
        margin-bottom: 20px;
        flex-wrap: wrap;
        align-items: center;
    }

    .historial-stats {
        margin-left: auto;
        color: var(--text-secondary);
        font-size: 14px;
        font-weight: 500;
    }

    .historial-table-container {
        overflow-x: auto;
        background: white;
        border-radius: 12px;
        border: 1px solid var(--border-color);
    }

    .historial-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 14px;
    }

    .historial-table thead {
        background: var(--input-bg);
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .historial-table th {
        padding: 16px;
        text-align: left;
        font-weight: 600;
        color: var(--text-primary);
        border-bottom: 2px solid var(--border-color);
        white-space: nowrap;
    }

    .historial-table td {
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-secondary);
    }

    .historial-table tbody tr {
        transition: all 0.2s ease;
    }

    .historial-table tbody tr:hover {
        background: var(--input-bg);
    }

    .historial-table tbody tr:last-child td {
        border-bottom: none;
    }

    /* Botón de acción en tabla */
    .btn-action-small {
        padding: 6px 14px;
        background: var(--primary-light);
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .btn-action-small:hover {
        background: var(--primary-color);
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(43, 122, 120, 0.2);
    }

    /* Status vacío */
    .empty-state {
        text-align: center;
        padding: 60px 20px;
        color: var(--text-secondary);
    }

    .empty-state-icon {
        font-size: 64px;
        margin-bottom: 20px;
        opacity: 0.5;
    }

    .empty-state h3 {
        font-size: 20px;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 10px;
    }

    .empty-state p {
        font-size: 16px;
        margin-bottom: 0;
    }

    /* Responsive para pestañas */
    @media (max-width: 768px) {
        .tabs-nav {
            flex-direction: column;
            gap: 0;
        }
        
        .tab-button {
            border-bottom: none;
            border-left: 3px solid transparent;
            text-align: left;
            padding: 12px 20px;
            bottom: 0;
        }
        
        .tab-button.active {
            border-left-color: var(--primary-color);
            border-bottom-color: transparent;
            background: rgba(43, 122, 120, 0.05);
        }
        
        .historial-table {
            font-size: 12px;
        }
        
        .historial-table th,
        .historial-table td {
            padding: 12px 8px;
        }
    }

        /* Estilos del panel de administrador */
        .admin-section {
            display: none;
            animation: fadeIn 0.5s ease-out;
        }

        .admin-section.active {
            display: block;
        }

        .admin-header {
            text-align: center;
            margin-bottom: 40px;
        }

        .admin-header h2 {
            color: var(--text-primary);
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .admin-header p {
            color: var(--text-secondary);
            font-size: 16px;
        }

        .admin-card {
            background: var(--input-bg);
            border: 2px solid var(--border-color);
            border-radius: 16px;
            padding: 30px;
            margin-bottom: 30px;
            transition: all 0.3s ease;
        }

        .admin-card:hover {
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
        }

        .admin-card h3 {
            color: var(--primary-color);
            font-size: 22px;
            font-weight: 600;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .table-controls {
            display: flex;
            gap: 12px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .btn-secondary {
            padding: 10px 20px;
            background: white;
            color: var(--primary-color);
            border: 2px solid var(--primary-color);
            border-radius: 10px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-secondary:hover {
            background: var(--primary-color);
            color: white;
            transform: translateY(-2px);
        }

        .filter-select {
            padding: 10px 16px;
            border: 2px solid var(--border-color);
            border-radius: 10px;
            font-family: inherit;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .filter-select:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .table-container {
            overflow-x: auto;
            background: white;
            border-radius: 12px;
            border: 1px solid var(--border-color);
        }

        .admin-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 14px;
        }

        .admin-table thead {
            background: var(--input-bg);
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .admin-table th {
            padding: 16px;
            text-align: left;
            font-weight: 600;
            color: var(--text-primary);
            border-bottom: 2px solid var(--border-color);
            white-space: nowrap;
        }

        .admin-table td {
            padding: 16px;
            border-bottom: 1px solid var(--border-color);
            color: var(--text-secondary);
        }

        .admin-table tbody tr {
            transition: all 0.2s ease;
        }

        .admin-table tbody tr:hover {
            background: var(--input-bg);
        }

        .admin-table tbody tr:last-child td {
            border-bottom: none;
        }

        .badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .badge-success {
            background: rgba(16, 185, 129, 0.1);
            color: var(--success-color);
        }

        .badge-error {
            background: rgba(239, 68, 68, 0.1);
            color: var(--error-color);
        }

        .badge-admin {
            background: rgba(139, 92, 246, 0.1);
            color: var(--secondary-color);
        }

        .badge-user {
            background: rgba(99, 102, 241, 0.1);
            color: var(--primary-color);
        }

        .btn-view {
            padding: 6px 14px;
            background: var(--primary-light);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-view:hover {
            background: var(--primary-color);
            transform: translateY(-1px);
        }

        /* Modal */
        .modal {
            display: none;        
            align-items: center;   
            justify-content: center; 
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(4px);
            animation: fadeIn 0.3s ease;
        }

        .modal.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background: white;
            border-radius: 20px;
            max-width: 900px;
            width: 90%;
            max-height: 90vh;
            overflow: hidden;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
            animation: slideUp 0.4s ease;
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 24px 30px;
            border-bottom: 2px solid var(--border-color);
            background: var(--input-bg);
        }

        .modal-header h3 {
            color: var(--text-primary);
            font-size: 24px;
            font-weight: 600;
            margin: 0;
        }

        .btn-close {
            background: none;
            border: none;
            font-size: 28px;
            color: var(--text-secondary);
            cursor: pointer;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .btn-close:hover {
            background: rgba(0, 0, 0, 0.05);
            color: var(--text-primary);
        }

        .modal-body {
            padding: 30px;
            overflow-y: auto;
            max-height: calc(90vh - 100px);
        }

        .detail-section {
            margin-bottom: 24px;
        }

        .detail-section h4 {
            color: var(--primary-color);
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .detail-header {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            padding: 20px;
            background: linear-gradient(to right, #f9fafb, #f3f4f6);
            border-radius: 12px;
            margin-bottom: 25px;
            position: sticky;
            top: 0px;
            z-index: 100;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .detail-badge {
            padding: 8px 16px;
            background: white;
            border: 2px solid var(--border-color);
            border-radius: 8px;
            font-weight: 500;
            font-size: 14px;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .detail-badge.badge-success {
            background: #f0fdf4;
            border-color: #10b981;
            color: #065f46;
        }

        .detail-badge.badge-error {
            background: #fef2f2;
            border-color: #ef4444;
            color: #991b1b;
        }

        .detail-content-html {
            line-height: 1.6;
        }

        .detail-content-html h1,
        .detail-content-html h2,
        .detail-content-html h3 {
            font-size: 1.1em !important;
            font-weight: 600;
            margin: 15px 0 10px 0;
            color: var(--text-primary);
        }

        .detail-content-html h2 {
            font-size: 1.05em !important;
        }

        .detail-content-html p {
            margin: 10px 0;
        }

        .detail-content-html ul,
        .detail-content-html ol {
            margin: 10px 0;
            padding-left: 25px;
        }

        .detail-content-html li {
            margin: 5px 0;
        }

        .detail-content-html strong {
            font-weight: 600;
            color: var(--text-primary);
        }

        .detail-image-container {
            margin: 15px 0;
            text-align: center;
        }

        .detail-image-container img {
            max-width: 100%;
            height: auto;
            transition: transform 0.3s ease;
        }

        .detail-image-container img:hover {
            transform: scale(1.02);
        }

        .detail-content {
            background: var(--input-bg);
            padding: 16px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            font-size: 14px;
            line-height: 1.6;
            color: var(--text-secondary);
        }

        .detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
            margin-bottom: 16px;
        }

        .detail-item {
            background: white;
            padding: 12px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
        }

        .detail-label {
            font-size: 12px;
            color: var(--text-light);
            text-transform: uppercase;
            font-weight: 600;
            margin-bottom: 4px;
        }

        .detail-value {
            font-size: 16px;
            color: var(--text-primary);
            font-weight: 600;
        }

        /* Responsive para admin */
        @media (max-width: 768px) {
            .table-controls {
                flex-direction: column;
            }

            .table-controls button,
            .table-controls select {
                width: 100%;
            }

            .admin-table {
                font-size: 12px;
            }

            .admin-table th,
            .admin-table td {
                padding: 10px;
            }

            .modal-content {
                width: 95%;
                max-height: 95vh;
            }

            .detail-grid {
                grid-template-columns: 1fr;
            }
        }

        /* ============================================
           SELECTOR DE IDIOMA (nuevo)
           ============================================ */
        .lang-switch {
            position: absolute;
            top: 16px;
            right: 16px;
            z-index: 2;
            display: flex;
            gap: 4px;
            background: rgba(255, 255, 255, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 999px;
            padding: 3px;
            backdrop-filter: blur(10px);
        }

        .lang-switch button {
            background: transparent;
            border: none;
            color: white;
            font: inherit;
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 0.5px;
            padding: 6px 12px;
            border-radius: 999px;
            cursor: pointer;
            opacity: 0.8;
            transition: all 0.2s ease;
        }

        .lang-switch button:hover { opacity: 1; }

        .lang-switch button[aria-pressed="true"] {
            background: white;
            color: var(--primary-color);
            opacity: 1;
        }

        .lang-switch button:focus-visible,
        .tab-button:focus-visible,
        .btn-primary:focus-visible,
        .btn-secondary:focus-visible {
            outline: 3px solid #fbbf24;
            outline-offset: 2px;
        }

        .lang-note {
            font-size: 13px;
            color: var(--text-secondary);
            margin-top: 8px;
        }

        .detail-meta-small {
            font-size: 12px;
            color: var(--text-light);
        }

        /* ============================================
           MIS TRANSFORMACIONES: lista + detalle en línea
           ============================================ */
        .page-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 20px;
            flex-wrap: wrap;
            margin: 10px 0 24px;
        }

        .page-head h2 {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .page-head p {
            color: var(--text-secondary);
            font-size: 15px;
        }

        .btn-new {
            padding: 14px 24px;
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font: inherit;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(43, 122, 120, 0.3);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            white-space: nowrap;
        }

        .btn-new:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 18px rgba(43, 122, 120, 0.4);
        }

        .trans-list {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .trans-card {
            background: white;
            border: 2px solid var(--border-color);
            border-radius: 16px;
            overflow: hidden;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .trans-card:hover { border-color: #cfd8dc; }

        .trans-card.open {
            border-color: var(--primary-light);
            box-shadow: 0 10px 30px rgba(43, 122, 120, 0.12);
        }

        .trans-card.running { border-color: var(--warning-color); }

        .trans-card.just-added { animation: cardIn 0.5s ease-out; }

        @keyframes cardIn {
            from { opacity: 0; transform: translateY(-12px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .trans-card-header {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 18px 22px;
            background: none;
            border: none;
            font: inherit;
            text-align: left;
            cursor: pointer;
            color: inherit;
        }

        .trans-card-header:focus-visible {
            outline: 3px solid #fbbf24;
            outline-offset: -3px;
        }

        .trans-card-main {
            flex: 1;
            min-width: 0;
        }

        .trans-title {
            font-size: 17px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .trans-sub {
            font-size: 13px;
            color: var(--text-secondary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .trans-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 999px;
            background: var(--input-bg);
            border: 1px solid var(--border-color);
            font-size: 12px;
            font-weight: 500;
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .chip-ok { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
        .chip-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
        .chip-warn { background: #fffbeb; border-color: #fde68a; color: #b45309; }
        .chip-running { background: #fffbeb; border-color: #fde68a; color: #92400e; }

        .chevron {
            font-size: 18px;
            color: var(--text-light);
            transition: transform 0.25s ease;
            flex-shrink: 0;
        }

        .trans-card.open .chevron { transform: rotate(180deg); }

        .trans-body {
            border-top: 1px solid var(--border-color);
            padding: 20px 22px 24px;
            background: linear-gradient(to bottom, #f9fafb, white 120px);
        }

        .detail-toolbar {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 18px;
        }

        .detail-toolbar .btn-download {
            margin-left: auto;
            padding: 8px 14px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 8px;
            font: inherit;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
        }

        .detail-toolbar .btn-download:hover { background: var(--primary-dark); }

        /* Pestañas del detalle */
        .dtabs {
            display: inline-flex;
            gap: 4px;
            padding: 4px;
            background: #eef2f3;
            border-radius: 12px;
            margin-bottom: 18px;
            flex-wrap: wrap;
        }

        .dtab {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            border: none;
            border-radius: 9px;
            background: transparent;
            font: inherit;
            font-size: 14px;
            font-weight: 600;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .dtab:hover { color: var(--primary-color); }

        .dtab[aria-selected="true"] {
            background: white;
            color: var(--primary-color);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        }

        .dtab:focus-visible { outline: 3px solid #fbbf24; outline-offset: 1px; }

        .dot {
            width: 16px;
            height: 16px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            font-size: 10px;
            line-height: 1;
            flex-shrink: 0;
        }

        .dot-ok { background: #d1fae5; color: #047857; }
        .dot-error { background: #fee2e2; color: #b91c1c; }
        .dot-none, .dot-pending { background: #e5e7eb; color: #6b7280; }
        .dot-loading {
            border: 2px solid #fde68a;
            border-top-color: var(--warning-color);
            animation: spin 0.8s linear infinite;
        }

        .dpanel { animation: fadeIn 0.3s ease; }

        .dpanel .result-content { margin-bottom: 16px; }

        .notice {
            padding: 28px 20px;
            text-align: center;
            color: var(--text-secondary);
            background: white;
            border: 1px dashed var(--border-color);
            border-radius: 12px;
        }

        .notice .spinner { width: 36px; height: 36px; margin-bottom: 12px; border-width: 3px; }
        .notice-error { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

        .teacher-box {
            background: #f0f9ff;
            border-left: 4px solid #3b82f6;
            border-radius: 12px;
            padding: 18px 20px;
            line-height: 1.7;
            color: var(--text-primary);
        }

        .teacher-box h4 {
            font-size: 15px;
            font-weight: 600;
            margin-bottom: 8px;
            color: #1e40af;
        }

        .original-box {
            margin-bottom: 16px;
            font-size: 14px;
            color: var(--text-secondary);
        }

        .original-box summary {
            cursor: pointer;
            font-weight: 600;
            color: var(--primary-color);
            padding: 4px 0;
        }

        .original-box div {
            margin-top: 8px;
            padding: 14px 16px;
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            white-space: pre-wrap;
        }

        /* Esqueleto mientras se genera el texto */
        .skeleton {
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 20px;
        }

        .skeleton span {
            display: block;
            height: 12px;
            margin: 12px 0;
            border-radius: 6px;
            background: linear-gradient(90deg, #eef2f3 25%, #f8fafb 50%, #eef2f3 75%);
            background-size: 200% 100%;
            animation: shimmer 1.4s infinite;
        }

        .skeleton span:first-child { height: 20px; width: 55%; }
        .skeleton span:nth-child(3) { width: 85%; }
        .skeleton span:nth-child(5) { width: 70%; }

        @keyframes shimmer {
            from { background-position: 200% 0; }
            to { background-position: -200% 0; }
        }

        .skeleton-label {
            margin-top: 14px;
            font-size: 14px;
            font-weight: 600;
            color: var(--warning-color);
        }

        /* Ventana nueva transformación */
        .modal-narrow { max-width: 720px; }

        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 8px;
        }

        .btn-inline { width: auto; padding: 12px 28px; }

        .char-count {
            text-align: right;
            font-size: 12px;
            color: var(--text-light);
            margin-top: 6px;
        }

        .admin-detail-row > td {
            background: #f9fafb;
            padding: 20px !important;
        }

        @media (max-width: 768px) {
            .trans-card-header { flex-wrap: wrap; }
            .trans-meta { justify-content: flex-start; width: 100%; }
            .dtabs { display: flex; }
            .dtab { flex: 1; justify-content: center; padding: 10px 8px; font-size: 13px; }
            .detail-toolbar .btn-download { margin-left: 0; }
        }

        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { animation: none !important; transition: none !important; }
        }

        /* La tira de pictogramas se muestra a su tamaño real (sin ampliarla) */
        .dpanel .pictogram-image {
            width: auto;
            max-width: 100%;
            margin: 4px auto 8px;
        }

/* El atributo hidden siempre oculta, aunque otra regla defina display */
[hidden] { display: none !important; }

/* Nivel e idioma en la misma fila dentro de la ventana de nueva transformación */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
}

/* =====================================================================
   CAJA DE ACCESO CON PESTAÑAS INFORMATIVAS
   ===================================================================== */
.auth-box { padding-top: 14px; }

.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color);
    margin: 0 -10px 28px;
}

.auth-tabs button {
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    position: relative;
    bottom: -2px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.auth-tabs button:hover { color: var(--primary-color); }
.auth-tabs button[aria-selected="true"] { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.auth-tabs button:focus-visible { outline: 3px solid #fbbf24; outline-offset: -3px; }

.info-text {
    max-width: 720px;
    margin: 0 auto;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.7;
}

.info-text p { margin-bottom: 14px; }
.info-text a { color: var(--primary-color); font-weight: 600; }
.info-text hr { border: none; border-top: 1px solid var(--border-color); margin: 20px 0; }

.rules-list { padding-left: 22px; }
.rules-list li { margin-bottom: 10px; padding-left: 4px; }
.rules-list strong { color: var(--primary-color); }

.plain-list { padding-left: 22px; margin-bottom: 14px; }
.plain-list li { margin-bottom: 6px; }

.contact-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.contact-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(43, 122, 120, 0.25);
    flex-shrink: 0;
}

.contact-head h3 { font-size: 18px; margin-bottom: 2px; }
.contact-role { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px !important; }

.no-code-note {
    margin-top: 22px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.no-code-note a { color: var(--primary-color); font-weight: 600; }

/* La caja de acceso no se desplaza al pasar el ratón (molesta al leer las pestañas) */
.auth-box:hover { transform: none; }

/* Imagen dentro de "¿Por qué LEdui?" */
.info-image {
    display: block;
    width: 100%;
    max-width: 440px;
    height: auto;
    margin: 6px auto 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* Llamada a escribir en "Contacto" */
.contact-cta {
    margin-top: 24px;
    padding: 24px;
    text-align: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(43, 122, 120, 0.08), rgba(78, 159, 126, 0.14));
    border: 2px solid rgba(43, 122, 120, 0.3);
}

.contact-cta h3 { font-size: 19px; color: var(--primary-dark); margin-bottom: 8px; }
.contact-cta p { margin-bottom: 16px; }
.contact-cta .btn-new { display: inline-block; text-decoration: none; color: white; font-size: 16px; padding: 14px 26px; }
